diff --git a/.changeset/famous-humans-confess.md b/.changeset/famous-humans-confess.md new file mode 100644 index 0000000..652b688 --- /dev/null +++ b/.changeset/famous-humans-confess.md @@ -0,0 +1,5 @@ +--- +"@qlik/eslint-config": patch +--- + +fix: enable react rules for ts/js files. fixes an issue where rules of hooks were not enable for files containing only hooks. diff --git a/packages/eslint-config/src/configs/react.js b/packages/eslint-config/src/configs/react.js index c3ab0ab..aedd6be 100644 --- a/packages/eslint-config/src/configs/react.js +++ b/packages/eslint-config/src/configs/react.js @@ -52,7 +52,7 @@ const reactConfig = { */ const reactJS = mergeConfigs(reactConfig, { name: "react-js", - files: ["**/*.jsx"], + files: ["**/*.js", "**/*.jsx"], rules: { // turn on/off or modify js rules necessary for react "react/jsx-filename-extension": [2, { extensions: [".js", ".jsx"] }], @@ -64,7 +64,7 @@ const reactJS = mergeConfigs(reactConfig, { */ const reactTS = mergeConfigs(reactConfig, { name: "react-ts", - files: ["**/*.tsx"], + files: ["**/*.ts", "**/*.tsx"], rules: { // turn on/off or modify js/ts rules necessary for react "react/jsx-filename-extension": [2, { extensions: [".js", ".jsx", ".ts", ".tsx"] }],