|
1 | | -module.exports = { |
2 | | - root: true, |
3 | | - extends: [ |
4 | | - 'eslint:recommended', |
5 | | - 'standard' |
6 | | - ], |
7 | | - parserOptions: { |
8 | | - sourceType: 'script', |
| 1 | +'use strict'; |
| 2 | + |
| 3 | +const globals = require('globals'); |
| 4 | +const eslintJS = require('@eslint/js'); |
| 5 | + |
| 6 | +module.exports = [ |
| 7 | + eslintJS.configs.recommended, |
| 8 | + { |
| 9 | + languageOptions: { |
| 10 | + sourceType: 'commonjs', |
| 11 | + globals: { |
| 12 | + ...globals.browser, |
| 13 | + ...globals.node, |
| 14 | + } |
| 15 | + }, |
| 16 | + rules: { |
| 17 | + 'indent': ['error', 4], |
| 18 | + 'no-shadow': ['error'], |
| 19 | + 'no-var': ['error'], |
| 20 | + 'no-unused-vars': ['error', { |
| 21 | + vars: 'all', |
| 22 | + args: 'none', |
| 23 | + caughtErrors: 'none', |
| 24 | + ignoreRestSiblings: false, |
| 25 | + ignoreUsingDeclarations: false, |
| 26 | + reportUsedIgnorePattern: false, |
| 27 | + }], |
| 28 | + 'operator-linebreak': ['error', 'after'], |
| 29 | + 'quote-props': ['error', 'consistent-as-needed'], |
| 30 | + 'quotes': ['error', 'single'], |
| 31 | + 'semi': ['error', 'always'], |
| 32 | + 'space-before-function-paren': ['error', 'never'], |
| 33 | + 'strict': ['error', 'safe'] |
| 34 | + }, |
9 | 35 | }, |
10 | | - env: { |
11 | | - 'browser': true, |
12 | | - 'node': true, |
| 36 | + { |
| 37 | + files: ['test/**/*.mjs'], |
| 38 | + languageOptions: { |
| 39 | + sourceType: 'module', |
| 40 | + globals: { |
| 41 | + afterEach: 'readonly', |
| 42 | + beforeEach: 'readonly', |
| 43 | + describe: 'readonly', |
| 44 | + it: 'readonly', |
| 45 | + }, |
| 46 | + }, |
| 47 | + rules: { |
| 48 | + 'no-unused-expressions': 0, |
| 49 | + 'comma-dangle': ['error', { |
| 50 | + arrays: 'always-multiline', |
| 51 | + objects: 'always-multiline', |
| 52 | + imports: 'never', |
| 53 | + exports: 'never', |
| 54 | + functions: 'ignore', |
| 55 | + }], |
| 56 | + }, |
13 | 57 | }, |
14 | | - 'rules': { |
15 | | - 'camelcase': 0, |
16 | | - 'comma-dangle': 0, |
17 | | - 'indent': ['error', 4], |
18 | | - 'new-cap': 0, |
19 | | - 'no-shadow': ['error'], |
20 | | - 'no-var': ['error'], |
21 | | - 'operator-linebreak': ['error', 'after'], |
22 | | - 'semi': ['error', 'always'], |
23 | | - 'space-before-function-paren': ['error', 'never'], |
24 | | - 'standard/no-callback-literal': 0, |
25 | | - 'n/no-callback-literal': 0, |
26 | | - "object-shorthand": 0, |
27 | | - } |
28 | | -}; |
| 58 | + { |
| 59 | + files: ['examples/**/*.js'], |
| 60 | + rules: { |
| 61 | + strict: 0, |
| 62 | + }, |
| 63 | + }, |
| 64 | +]; |
0 commit comments