|
1 | | -import eslint from '@eslint/js'; |
| 1 | +import js from '@eslint/js'; |
| 2 | +import json from '@eslint/json'; |
| 3 | +import jsonc from 'eslint-plugin-jsonc'; |
| 4 | +import markdown from '@eslint/markdown'; |
2 | 5 | import stylistic from '@stylistic/eslint-plugin'; |
3 | | -import tseslint from 'typescript-eslint'; |
| 6 | +import ts from 'typescript-eslint'; |
| 7 | +import yml from 'eslint-plugin-yml'; |
4 | 8 |
|
5 | | -export default tseslint.config( |
6 | | - eslint.configs.recommended, |
7 | | - stylistic.configs.customize({ |
8 | | - arrowParens: false, |
9 | | - blockSpacing: true, |
10 | | - braceStyle: 'stroustrup', |
11 | | - commaDangle: 'never', |
12 | | - flat: true, |
13 | | - indent: 4, |
14 | | - jsx: false, |
15 | | - quoteProps: 'consistent-as-needed', |
16 | | - quotes: 'single', |
17 | | - semi: true |
18 | | - }), |
19 | | - ...tseslint.configs.strict, |
20 | | - ...tseslint.configs.stylistic, |
| 9 | +export default ts.config([ |
21 | 10 | { |
22 | | - ignores: ['./bin'] |
| 11 | + name: 'global-ignore', |
| 12 | + ignores: ['./bin', '**/package-lock.json'] |
| 13 | + }, |
| 14 | + { |
| 15 | + // https://github.com/eslint-stylistic/eslint-stylistic |
| 16 | + // https://github.com/typescript-eslint/typescript-eslint |
| 17 | + name: 'javascript-typescript', |
| 18 | + files: ['**/*.js', '**/*.ts'], |
| 19 | + extends: [ |
| 20 | + js.configs.recommended, |
| 21 | + stylistic.configs.customize({ |
| 22 | + arrowParens: false, |
| 23 | + blockSpacing: true, |
| 24 | + braceStyle: 'stroustrup', |
| 25 | + commaDangle: 'never', |
| 26 | + indent: 4, |
| 27 | + jsx: false, |
| 28 | + quoteProps: 'consistent-as-needed', |
| 29 | + quotes: 'single', |
| 30 | + semi: true, |
| 31 | + severity: 'error' |
| 32 | + }), |
| 33 | + ts.configs.strict, |
| 34 | + ts.configs.stylistic |
| 35 | + ] |
| 36 | + }, |
| 37 | + { |
| 38 | + // https://github.com/eslint/json |
| 39 | + // https://github.com/ota-meshi/eslint-plugin-jsonc |
| 40 | + name: 'json', |
| 41 | + files: ['**/*.json'], |
| 42 | + language: 'json/json', |
| 43 | + extends: [json.configs.recommended, jsonc.configs['flat/recommended-with-json']] |
| 44 | + }, |
| 45 | + { |
| 46 | + // https://github.com/eslint/json |
| 47 | + // https://github.com/ota-meshi/eslint-plugin-jsonc |
| 48 | + name: 'jsonc', |
| 49 | + files: ['**/*.jsonc', './.vscode/*.json', '**/tsconfig.json'], |
| 50 | + language: 'json/jsonc', |
| 51 | + extends: [json.configs.recommended, jsonc.configs['flat/recommended-with-jsonc']] |
| 52 | + }, |
| 53 | + { |
| 54 | + // https://github.com/eslint/markdown |
| 55 | + name: 'markdown', |
| 56 | + files: ['**/*.md'], |
| 57 | + language: 'markdown/gfm', |
| 58 | + extends: [markdown.configs.recommended] |
| 59 | + }, |
| 60 | + { |
| 61 | + // https://github.com/ota-meshi/eslint-plugin-yml |
| 62 | + name: 'yml', |
| 63 | + files: ['**/*.yml', '**/*.yaml'], |
| 64 | + extends: [yml.configs['flat/recommended']] |
23 | 65 | } |
24 | | -); |
| 66 | +]); |
0 commit comments