|
| 1 | +import globals from 'globals'; |
| 2 | +import eslintPluginEslint from '@eslint/js'; |
| 3 | +import eslintPluginStylistic from '@stylistic/eslint-plugin-js'; |
| 4 | +import eslintPluginHtml from 'eslint-plugin-html'; |
| 5 | + |
| 6 | +const config = [ |
| 7 | + { |
| 8 | + files: ['**/*.js'], |
| 9 | + languageOptions: { |
| 10 | + globals: { |
| 11 | + ...globals.browser, |
| 12 | + ...globals.node, |
| 13 | + define: 'readonly', |
| 14 | + L: 'writable' |
| 15 | + } |
| 16 | + }, |
| 17 | + plugins: { |
| 18 | + ...eslintPluginStylistic.configs['all-flat'].plugins |
| 19 | + }, |
| 20 | + rules: { |
| 21 | + ...eslintPluginEslint.configs['recommended'].rules, |
| 22 | + ...eslintPluginStylistic.configs['all-flat'].rules, |
| 23 | + '@stylistic/js/brace-style': ['error', '1tbs'], |
| 24 | + '@stylistic/js/comma-dangle': ['error', 'only-multiline'], |
| 25 | + '@stylistic/js/dot-location': ['error', 'property'], |
| 26 | + '@stylistic/js/function-call-argument-newline': ['error', 'consistent'], |
| 27 | + '@stylistic/js/indent': ['error', 'tab'], |
| 28 | + '@stylistic/js/multiline-comment-style': 'off', |
| 29 | + '@stylistic/js/no-tabs': 'off', |
| 30 | + '@stylistic/js/object-curly-spacing': ['error', 'always'], |
| 31 | + '@stylistic/js/padded-blocks': 'off', |
| 32 | + '@stylistic/js/quotes': ['error', 'single'], |
| 33 | + '@stylistic/js/quote-props': ['error', 'consistent-as-needed'], |
| 34 | + '@stylistic/js/semi': ['error', 'always'], |
| 35 | + '@stylistic/js/space-before-function-paren': ['error', 'never'], |
| 36 | + '@stylistic/js/array-element-newline': ["error", "consistent"], |
| 37 | + 'no-lonely-if': 'error', |
| 38 | + 'no-unused-expressions': ['error', { allowTernary: true }] |
| 39 | + } |
| 40 | + }, |
| 41 | + { |
| 42 | + files: ['**/*.html'], |
| 43 | + plugins: { |
| 44 | + eslintPluginHtml, |
| 45 | + }, |
| 46 | + settings: { |
| 47 | + 'html/report-bad-indent': 2, |
| 48 | + }, |
| 49 | + } |
| 50 | +]; |
| 51 | + |
| 52 | +export default config; |
0 commit comments