Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Split react and non-react lints

Manav Rathi666cd002c701
diff --git a/packages/build-config/eslintrc-typescript-react.js b/packages/build-config/eslintrc-typescript-react.js
new file mode 100644
index 0000000000..faec25874e
--- /dev/null
+++ b/packages/build-config/eslintrc-typescript-react.js
@@ -0,0 +1,24 @@
+/* eslint-env node */
+module.exports = {
+ extends: [
+ "eslint:recommended",
+ "plugin:react-hooks/recommended",
+ "plugin:@typescript-eslint/strict-type-checked",
+ "plugin:@typescript-eslint/stylistic-type-checked",
+ ],
+ plugins: ["@typescript-eslint", "react-namespace-import"],
+ parser: "@typescript-eslint/parser",
+ parserOptions: {
+ project: true,
+ },
+ root: true,
+ ignorePatterns: [".eslintrc.js"],
+ rules: {
+ // The recommended way to import React is:
+ //
+ // import * as React from "react";
+ //
+ // This rule enforces that.
+ "react-namespace-import/no-namespace-import": "error",
+ },
+};
diff --git a/packages/build-config/eslintrc-typescript.js b/packages/build-config/eslintrc-typescript.js
index faec25874e..6b3a3c457b 100644
--- a/packages/build-config/eslintrc-typescript.js
+++ b/packages/build-config/eslintrc-typescript.js
@@ -2,23 +2,14 @@
module.exports = {
extends: [
"eslint:recommended",
- "plugin:react-hooks/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
- plugins: ["@typescript-eslint", "react-namespace-import"],
+ plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
root: true,
ignorePatterns: [".eslintrc.js"],
- rules: {
- // The recommended way to import React is:
- //
- // import * as React from "react";
- //
- // This rule enforces that.
- "react-namespace-import/no-namespace-import": "error",
- },
};
diff --git a/packages/next/.eslintrc.js b/packages/next/.eslintrc.js
index 72519a5735..4bc0524ffb 100644
--- a/packages/next/.eslintrc.js
+++ b/packages/next/.eslintrc.js
@@ -1,5 +1,5 @@
module.exports = {
- extends: ["@/build-config/eslintrc-typescript"],
+ extends: ["@/build-config/eslintrc-typescript-react"],
parserOptions: {
tsconfigRootDir: __dirname,
},
diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js
index a9a3393e03..7372de7294 100644
--- a/packages/ui/.eslintrc.js
+++ b/packages/ui/.eslintrc.js
@@ -1,5 +1,5 @@
module.exports = {
- extends: ["@/build-config/eslintrc-typescript"],
+ extends: ["@/build-config/eslintrc-typescript-react"],
parserOptions: {
tsconfigRootDir: __dirname,
},