add cq tooling
This commit is contained in:
74
eslint.config.js
Normal file
74
eslint.config.js
Normal file
@@ -0,0 +1,74 @@
|
||||
import globals from 'globals';
|
||||
import js from '@eslint/js';
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
export default [
|
||||
{
|
||||
ignores: ['dist/**', 'node_modules/**', '*.min.js', '*.d.ts'],
|
||||
},
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2024,
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
},
|
||||
},
|
||||
linterOptions: {
|
||||
reportUnusedDisableDirectives: true,
|
||||
},
|
||||
rules: {
|
||||
...js.configs.recommended.rules,
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'no-constant-condition': ['error', { checkLoops: false }],
|
||||
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
|
||||
quotes: ['error', 'single', { avoidEscape: true }],
|
||||
semi: ['error', 'always'],
|
||||
indent: ['error', 2, { SwitchCase: 1 }],
|
||||
'comma-dangle': ['error', 'always-multiline'],
|
||||
'arrow-parens': ['error', 'as-needed'], // Changed from 'avoid' to 'as-needed'
|
||||
'object-curly-spacing': ['error', 'always'],
|
||||
'array-bracket-spacing': ['error', 'never'],
|
||||
'space-before-function-paren': [
|
||||
'error',
|
||||
{
|
||||
anonymous: 'never',
|
||||
named: 'never',
|
||||
asyncArrow: 'always',
|
||||
},
|
||||
],
|
||||
'no-trailing-spaces': 'error',
|
||||
'eol-last': ['error', 'always'],
|
||||
'prefer-const': 'error',
|
||||
'no-var': 'error',
|
||||
eqeqeq: ['error', 'always'],
|
||||
curly: ['error', 'all'],
|
||||
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
|
||||
'keyword-spacing': ['error', { before: true, after: true }],
|
||||
'space-infix-ops': 'error',
|
||||
'comma-spacing': ['error', { before: false, after: true }],
|
||||
'no-multi-spaces': 'error',
|
||||
'no-irregular-whitespace': 'error',
|
||||
'no-mixed-spaces-and-tabs': 'error',
|
||||
'no-else-return': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/TokenCleaner.js'],
|
||||
rules: {
|
||||
'no-useless-escape': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.test.js', '**/*.spec.js'],
|
||||
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user