-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(preset-web): upgrade to flat eslint config
Note: ESLint v9 is deprecating the legacy .eslintrc.json configuration file, so it has been converted to the new flat TypeScript configuration format
- Loading branch information
Showing
8 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
import globals from 'globals'; | ||
|
||
import presetESMConfig from 'presetter-preset-esm/eslint.config'; | ||
|
||
import tailwind from 'eslint-plugin-tailwindcss'; | ||
import testing from 'eslint-plugin-testing-library'; | ||
|
||
import type { Linter } from 'eslint'; | ||
|
||
export default [ | ||
...presetESMConfig, | ||
...tailwind.configs['flat/recommended'], | ||
testing.configs['flat/dom'], | ||
{ | ||
name: 'presetter-preset-web', | ||
languageOptions: { | ||
globals: globals.browser, | ||
}, | ||
}, | ||
] as Linter.Config[]; |
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,8 @@ | ||
import presetConfig from 'presetter-preset-web/eslint.config'; | ||
|
||
export default [ | ||
...presetConfig, | ||
{ | ||
ignores: ['{test}/**', 'types/**', 'generated/**', '{output}/**'], | ||
}, | ||
]; |
21 changes: 21 additions & 0 deletions
21
packages/preset-web/types/eslint-plugin-tailwindcss/index.d.ts
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,21 @@ | ||
import type { ESLint, Linter } from 'eslint'; | ||
|
||
export default declare as ESLint.Plugin & { | ||
configs: { | ||
'flat/recommended': [ | ||
{ | ||
plugins: Linter.PluginsRecord; | ||
languageOptions: Linter.LanguageOptions; | ||
}, | ||
{ | ||
rules: Linter.RulesRecord; | ||
}, | ||
]; | ||
'recommended': { | ||
plugins: string[]; | ||
languageOptions: Linter.LanguageOptions; | ||
rules: Linter.RulesRecord; | ||
}; | ||
}; | ||
rules: Linter.RulesRecord; | ||
}; |
23 changes: 23 additions & 0 deletions
23
packages/preset-web/types/eslint-plugin-testing-library/index.d.ts
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,23 @@ | ||
import type { ESLint, Linter } from 'eslint'; | ||
|
||
export default declare as ESLint.Plugin & { | ||
configs: { | ||
'flat/dom': { | ||
plugins: Linter.PluginsRecord; | ||
rules: Linter.RulesRecord; | ||
}; | ||
'flat/react': { | ||
plugins: Linter.PluginsRecord; | ||
rules: Linter.RulesRecord; | ||
}; | ||
'dom': { | ||
plugins: string[]; | ||
rules: Linter.RulesRecord; | ||
}; | ||
'react': { | ||
plugins: string[]; | ||
rules: Linter.RulesRecord; | ||
}; | ||
}; | ||
rules: Linter.RulesRecord; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.