|
| 1 | +import stylisticJs from '@stylistic/eslint-plugin-js' |
| 2 | +import eslint from '@eslint/js'; |
| 3 | +import tseslint from 'typescript-eslint'; |
| 4 | +import globals from 'globals'; |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + { ignores: ["build", ".tmptest", "lib", "examples", "bench"] }, |
| 8 | + eslint.configs.recommended, |
| 9 | + ...tseslint.configs.recommended, |
| 10 | + ...tseslint.configs.stylistic, |
| 11 | + { |
| 12 | + "languageOptions": { |
| 13 | + "parser": tseslint.parser, |
| 14 | + "parserOptions": { |
| 15 | + "lib": ["es2023"], |
| 16 | + "module": "commonjs", |
| 17 | + "moduleResolution": "node", |
| 18 | + "target": "es2022", |
| 19 | + |
| 20 | + "strict": true, |
| 21 | + "esModuleInterop": true, |
| 22 | + "skipLibCheck": true, |
| 23 | + "include": [ |
| 24 | + "bin/**/*.ts", |
| 25 | + "src/**/*.ts", |
| 26 | + "test/**/*.ts" |
| 27 | + ], |
| 28 | + "outDir": "./lib", |
| 29 | + "declaration": true, |
| 30 | + "pretty": true, |
| 31 | + "sourceMap": true |
| 32 | + }, |
| 33 | + "globals": { |
| 34 | + ...globals.commonjs, |
| 35 | + ...globals.node, |
| 36 | + ...globals.es6 |
| 37 | + }, |
| 38 | + }, |
| 39 | + }, |
| 40 | + { |
| 41 | + plugins: { |
| 42 | + '@stylistic/js': stylisticJs |
| 43 | + }, |
| 44 | + files: [ |
| 45 | + "bin/**/*.ts", |
| 46 | + 'bench/**/*.ts', |
| 47 | + 'src/**/*.ts', |
| 48 | + 'test/**/*.ts', |
| 49 | + ], |
| 50 | + rules: { |
| 51 | + '@stylistic/js/max-len': [ 2, { |
| 52 | + 'code': 120, |
| 53 | + 'ignoreComments': true |
| 54 | + } ], |
| 55 | + "@stylistic/js/array-bracket-spacing": ["error", "always"], |
| 56 | + "@stylistic/js/operator-linebreak": ["error", "after"], |
| 57 | + "@stylistic/js/linebreak-style": ["error", "unix"], |
| 58 | + "@stylistic/js/brace-style": ["error", "1tbs", { "allowSingleLine": true }], |
| 59 | + '@stylistic/js/indent': ["error", 2, { |
| 60 | + "SwitchCase": 1, |
| 61 | + "FunctionDeclaration": { "parameters": "first" }, |
| 62 | + "FunctionExpression": { "parameters": "first" } |
| 63 | + }], |
| 64 | + } |
| 65 | + } |
| 66 | +); |
0 commit comments