|
1 | | -import nodePlugin from 'eslint-plugin-n' |
2 | | -import mocha from 'eslint-plugin-mocha' |
3 | 1 | import globals from 'globals' |
4 | | -import js from '@eslint/js' |
5 | | -import eslintConfigPrettier from 'eslint-config-prettier' |
6 | | -import eslint from '@eslint/js' |
7 | | -import typescriptEslint from 'typescript-eslint' |
| 2 | +import pluginJs from '@eslint/js' |
| 3 | +import tseslint from 'typescript-eslint' |
| 4 | +import mocha from 'eslint-plugin-mocha' |
| 5 | +import stylistic from '@stylistic/eslint-plugin' |
8 | 6 |
|
| 7 | +/** @type {import('eslint').Linter.Config[]} */ |
9 | 8 | export default [ |
10 | 9 | { |
11 | | - ignores: ['packages/*/node_modules', '**/docs', 'packages/*/dist/*'], |
| 10 | + ignores: ['**/dist/', '**/*.js'], |
12 | 11 | }, |
13 | | - js.configs.recommended, |
14 | | - nodePlugin.configs['flat/recommended-script'], |
| 12 | + { languageOptions: { globals: globals.node } }, |
| 13 | + pluginJs.configs.recommended, |
| 14 | + ...tseslint.configs.recommended, |
15 | 15 | mocha.configs['flat'].recommended, |
16 | | - ...typescriptEslint.configs.recommended, |
17 | | - eslintConfigPrettier, |
| 16 | + stylistic.configs['recommended-flat'], |
18 | 17 | { |
19 | | - languageOptions: { |
20 | | - globals: { |
21 | | - ...globals.node, |
22 | | - ...globals.mocha, |
23 | | - assert: false, |
24 | | - makeTestFeature: false, |
25 | | - shouldReject: false, |
26 | | - }, |
27 | | - ecmaVersion: 12, |
28 | | - sourceType: 'commonjs', |
29 | | - }, |
30 | | - |
31 | 18 | rules: { |
32 | | - 'no-extra-semi': 'off', |
33 | | - '@typescript-eslint/no-extra-semi': 'off', |
34 | | - 'n/no-process-exit': 'off', |
35 | | - 'no-var': 'error', |
36 | | - |
37 | | - 'n/no-extraneous-import': [ |
38 | | - 'error', |
39 | | - { |
40 | | - allowModules: ['sinon', 'chai'], |
41 | | - }, |
42 | | - ], |
43 | | - |
44 | | - 'n/no-missing-import': 'off', |
45 | | - 'n/no-missing-require': 'off', |
46 | | - 'n/no-unpublished-import': 'off', |
47 | | - 'n/no-unpublished-require': 'off', |
48 | | - 'n/no-unsupported-features/es-builtins': 'error', |
49 | | - 'n/no-unsupported-features/es-syntax': 'off', |
50 | | - 'n/no-unsupported-features/node-builtins': 'error', |
51 | | - 'n/hashbang': 'off', |
52 | | - 'object-shorthand': 'error', |
53 | | - 'prefer-arrow-callback': 'error', |
54 | | - 'prefer-const': 'error', |
55 | | - 'prefer-template': 'error', |
56 | | - 'mocha/no-exclusive-tests': 'error', |
57 | | - 'mocha/no-hooks-for-single-case': 'off', |
58 | 19 | 'mocha/no-mocha-arrows': 'off', |
59 | | - 'mocha/no-pending-tests': 'error', |
60 | 20 | 'mocha/no-setup-in-describe': 'off', |
61 | | - strict: ['error', 'never'], |
62 | | - 'valid-jsdoc': 'off', |
63 | | - '@typescript-eslint/no-var-requires': 'off', |
64 | | - '@typescript-eslint/no-empty-function': 'off', |
65 | | - '@typescript-eslint/no-require-imports': 'off', |
| 21 | + 'mocha/no-exclusive-tests': 'error', |
| 22 | + '@stylistic/arrow-parens': ['error', 'as-needed'], |
| 23 | + '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }], |
| 24 | + '@stylistic/quotes': ['error', 'single', { avoidEscape: true }], |
| 25 | + 'object-shorthand': ['error', 'always', { avoidQuotes: true }], |
66 | 26 | }, |
67 | 27 | }, |
68 | 28 | ] |
0 commit comments