Skip to content

Commit

Permalink
fix(linter): scope js and ts shared configs to js and ts files (#28381)
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez authored and jaysoo committed Oct 14, 2024
1 parent 371d204 commit e458ecf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/eslint-plugin/src/flat-configs/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ const isPrettierAvailable =
* related plugins and rules below.
*/
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.js', '**/*.jsx'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
},
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
{
languageOptions: {
Expand Down
6 changes: 4 additions & 2 deletions packages/eslint-plugin/src/flat-configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ const isPrettierAvailable =
* to one ecosystem, such as React, Angular, Node etc.
*/
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
},
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
{
plugins: { '@typescript-eslint': tseslint.plugin },
Expand Down

0 comments on commit e458ecf

Please sign in to comment.