Skip to content

Commit c3b77e7

Browse files
authored
fix(linter): scope js and ts shared configs to js and ts files (nrwl#28381)
1 parent db10812 commit c3b77e7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/eslint-plugin/src/flat-configs/javascript.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ const isPrettierAvailable =
2323
* related plugins and rules below.
2424
*/
2525
export default tseslint.config(
26-
eslint.configs.recommended,
27-
...tseslint.configs.recommended,
26+
{
27+
files: ['**/*.js', '**/*.jsx'],
28+
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
29+
},
2830
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
2931
{
3032
languageOptions: {

packages/eslint-plugin/src/flat-configs/typescript.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ const isPrettierAvailable =
1414
* to one ecosystem, such as React, Angular, Node etc.
1515
*/
1616
export default tseslint.config(
17-
eslint.configs.recommended,
18-
...tseslint.configs.recommended,
17+
{
18+
files: ['**/*.ts', '**/*.tsx'],
19+
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
20+
},
1921
...(isPrettierAvailable ? [require('eslint-config-prettier')] : []),
2022
{
2123
plugins: { '@typescript-eslint': tseslint.plugin },

0 commit comments

Comments
 (0)