-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an experimental flat config support
- Loading branch information
Showing
12 changed files
with
227 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import eslint from '@eslint/js'; | ||
import importPlugin from 'eslint-plugin-import'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
import config from './index.js'; | ||
|
||
export default [ | ||
eslint.configs.recommended, | ||
...tseslint | ||
.config( | ||
...tseslint.configs.recommendedTypeChecked, | ||
...tseslint.configs.stylisticTypeChecked, | ||
eslintConfigPrettier, | ||
importPlugin.flatConfigs.recommended, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: true, | ||
}, | ||
}, | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': [ | ||
'.cjs', | ||
'.cts', | ||
'.ctsx', | ||
'.js', | ||
'.jsx', | ||
'.mjs', | ||
'.mts', | ||
'.mtsx', | ||
'.ts', | ||
'.tsx', | ||
], | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: config.rules, | ||
}, | ||
) | ||
.map((config) => ({ | ||
...config, | ||
files: ['**/*.{cts,ctsx,mts,mtsx,ts,tsx}'], | ||
})), | ||
{ | ||
files: ['**/*.d.ts', '**/*.d.*.ts'], | ||
rules: { | ||
'import/no-default-export': 'off', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import jest from 'eslint-plugin-jest'; | ||
|
||
import config from './index.js'; | ||
|
||
export default [ | ||
{ | ||
files: ['**/*.test.*'], | ||
...jest.configs['flat/recommended'], | ||
rules: { | ||
...jest.configs['flat/recommended'].rules, | ||
...config.rules, | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import jsxA11y from 'eslint-plugin-jsx-a11y'; | ||
|
||
import config from './index.js'; | ||
|
||
export default [ | ||
jsxA11y.flatConfigs.recommended, | ||
{ | ||
rules: config.rules, | ||
}, | ||
].map((config) => ({ | ||
...config, | ||
files: ['**/*.{ctsx,jsx,mtsx,tsx}'], | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import nodePlugin from 'eslint-plugin-n'; | ||
|
||
import config from './index.js'; | ||
|
||
export default [ | ||
nodePlugin.configs['flat/recommended'], | ||
{ | ||
rules: config.rules, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters