|
| 1 | +import xo from 'eslint-config-xo' |
| 2 | +import xoBrowser from 'eslint-config-xo/browser' |
| 3 | +import eslintPluginImport from 'eslint-plugin-import' |
| 4 | +import eslintPluginUnicorn from 'eslint-plugin-unicorn' |
| 5 | +import globals from 'globals' |
| 6 | + |
| 7 | +export default [ |
| 8 | + eslintPluginImport.flatConfigs.errors, |
| 9 | + eslintPluginImport.flatConfigs.warnings, |
| 10 | + eslintPluginUnicorn.configs['flat/recommended'], |
| 11 | + ...xo, |
| 12 | + ...xoBrowser, |
| 13 | + { |
| 14 | + ignores: [ |
| 15 | + '**/*.min.js', |
| 16 | + '**/dist/', |
| 17 | + '.babelrc.js' |
| 18 | + ] |
| 19 | + }, |
| 20 | + { |
| 21 | + rules: { |
| 22 | + '@stylistic/comma-dangle': 'off', |
| 23 | + '@stylistic/function-paren-newline': 'off', |
| 24 | + '@stylistic/indent': 'off', |
| 25 | + '@stylistic/indent-binary-ops': 'off', |
| 26 | + '@stylistic/jsx-quotes': 'off', |
| 27 | + '@stylistic/max-len': 'off', |
| 28 | + '@stylistic/object-curly-spacing': 'off', |
| 29 | + '@stylistic/operator-linebreak': 'off', |
| 30 | + '@stylistic/quotes': 'off', |
| 31 | + '@stylistic/semi': 'off', |
| 32 | + 'arrow-body-style': 'off', |
| 33 | + 'capitalized-comments': 'off', |
| 34 | + 'comma-dangle': ['error', 'never'], |
| 35 | + 'import/extensions': [ |
| 36 | + 'error', |
| 37 | + 'ignorePackages', |
| 38 | + { |
| 39 | + js: 'always' |
| 40 | + } |
| 41 | + ], |
| 42 | + 'import/first': 'error', |
| 43 | + 'import/newline-after-import': 'error', |
| 44 | + 'import/no-absolute-path': 'error', |
| 45 | + 'import/no-amd': 'error', |
| 46 | + 'import/no-cycle': [ |
| 47 | + 'error', |
| 48 | + { |
| 49 | + ignoreExternal: true |
| 50 | + } |
| 51 | + ], |
| 52 | + 'import/no-duplicates': 'error', |
| 53 | + 'import/no-extraneous-dependencies': 'error', |
| 54 | + 'import/no-mutable-exports': 'error', |
| 55 | + 'import/no-named-as-default': 'error', |
| 56 | + 'import/no-named-as-default-member': 'error', |
| 57 | + 'import/no-named-default': 'error', |
| 58 | + 'import/no-self-import': 'error', |
| 59 | + 'import/no-unassigned-import': ['error'], |
| 60 | + 'import/no-useless-path-segments': 'error', |
| 61 | + 'import/order': 'error', |
| 62 | + indent: [ |
| 63 | + 'error', |
| 64 | + 2, |
| 65 | + { |
| 66 | + MemberExpression: 'off', |
| 67 | + SwitchCase: 1 |
| 68 | + } |
| 69 | + ], |
| 70 | + 'logical-assignment-operators': 'off', |
| 71 | + 'max-params': ['warn', 5], |
| 72 | + 'multiline-ternary': ['error', 'always-multiline'], |
| 73 | + 'new-cap': [ |
| 74 | + 'error', |
| 75 | + { |
| 76 | + properties: false |
| 77 | + } |
| 78 | + ], |
| 79 | + 'no-console': 'error', |
| 80 | + 'no-negated-condition': 'off', |
| 81 | + 'object-curly-spacing': ['error', 'always'], |
| 82 | + 'operator-linebreak': ['error', 'after'], |
| 83 | + 'prefer-object-has-own': 'off', |
| 84 | + 'prefer-template': 'error', |
| 85 | + semi: ['error', 'never'], |
| 86 | + strict: 'error', |
| 87 | + 'unicorn/explicit-length-check': 'off', |
| 88 | + 'unicorn/filename-case': 'off', |
| 89 | + 'unicorn/no-anonymous-default-export': 'off', |
| 90 | + 'unicorn/no-array-callback-reference': 'off', |
| 91 | + 'unicorn/no-array-method-this-argument': 'off', |
| 92 | + 'unicorn/no-null': 'off', |
| 93 | + 'unicorn/no-typeof-undefined': 'off', |
| 94 | + 'unicorn/no-unused-properties': 'error', |
| 95 | + 'unicorn/numeric-separators-style': 'off', |
| 96 | + 'unicorn/prefer-array-flat': 'off', |
| 97 | + 'unicorn/prefer-at': 'off', |
| 98 | + 'unicorn/prefer-dom-node-dataset': 'off', |
| 99 | + 'unicorn/prefer-global-this': 'off', // added to avoid the error: 'Use `globalThis` instead of `window` or `global`' |
| 100 | + 'unicorn/prefer-module': 'off', |
| 101 | + 'unicorn/prefer-query-selector': 'off', |
| 102 | + 'unicorn/prefer-spread': 'off', |
| 103 | + 'unicorn/prefer-string-raw': 'off', |
| 104 | + 'unicorn/prefer-string-replace-all': 'off', |
| 105 | + 'unicorn/prefer-structured-clone': 'off', |
| 106 | + 'unicorn/prevent-abbreviations': 'off' |
| 107 | + } |
| 108 | + }, |
| 109 | + { |
| 110 | + files: ['**/*.{js,mjs}'], |
| 111 | + languageOptions: { |
| 112 | + sourceType: 'module' |
| 113 | + } |
| 114 | + }, |
| 115 | + { |
| 116 | + files: ['build/**'], |
| 117 | + languageOptions: { |
| 118 | + globals: { |
| 119 | + ...globals.node |
| 120 | + }, |
| 121 | + sourceType: 'module' |
| 122 | + }, |
| 123 | + rules: { |
| 124 | + 'no-console': 'off', |
| 125 | + 'unicorn/prefer-top-level-await': 'off' |
| 126 | + } |
| 127 | + } |
| 128 | +] |
0 commit comments