Split react and non-react lints
This commit is contained in:
parent
8f5b462736
commit
666cd002c7
4 changed files with 27 additions and 12 deletions
24
packages/build-config/eslintrc-typescript-react.js
Normal file
24
packages/build-config/eslintrc-typescript-react.js
Normal file
|
@ -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",
|
||||
},
|
||||
};
|
|
@ -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",
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
extends: ["@/build-config/eslintrc-typescript"],
|
||||
extends: ["@/build-config/eslintrc-typescript-react"],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module.exports = {
|
||||
extends: ["@/build-config/eslintrc-typescript"],
|
||||
extends: ["@/build-config/eslintrc-typescript-react"],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue