mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Enable TypeScript in eslint-plugin-react-forget
This commit is contained in:
@@ -5,4 +5,4 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
module.exports = { presets: ["@babel/preset-env"] };
|
||||
module.exports = { presets: ["@babel/preset-env", "@babel/preset-typescript"] };
|
||||
|
||||
@@ -10,17 +10,18 @@
|
||||
"main": "./lib/index.js",
|
||||
"exports": "./lib/index.js",
|
||||
"scripts": {
|
||||
"build": ":",
|
||||
"build": "tsc",
|
||||
"lint": "npm-run-all \"lint:*\"",
|
||||
"lint:eslint-docs": "npm-run-all \"update:eslint-docs -- --check\"",
|
||||
"lint:js": "eslint .",
|
||||
"test": "jest",
|
||||
"test": "tsc && jest",
|
||||
"update:eslint-docs": "eslint-doc-generator"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.22.4",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@types/node": "^20.2.5",
|
||||
"babel-jest": "^29.0.3",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-doc-generator": "^1.0.0",
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ import ReactForgetDiagnostics from "./rules/ReactForgetDiagnostics";
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
"react-forget-diagnoatics": ReactForgetDiagnostics,
|
||||
"react-forget-diagnostics": ReactForgetDiagnostics,
|
||||
},
|
||||
};
|
||||
+6
-2
@@ -5,7 +5,9 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
export default {
|
||||
import type { Rule } from "eslint";
|
||||
|
||||
const rule: Rule.RuleModule = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
@@ -13,7 +15,9 @@ export default {
|
||||
recommended: true,
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
create(_context: Rule.RuleContext) {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
|
||||
export default rule;
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "@tsconfig/node16-strictest/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"outDir": "dist",
|
||||
"jsx": "react-jsxdev",
|
||||
|
||||
// weaken strictness from preset
|
||||
"importsNotUsedAsValues": "remove",
|
||||
"noUncheckedIndexedAccess": false,
|
||||
"noUnusedParameters": false,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"target": "ES2015",
|
||||
// ideally turn off only during dev, or on a per-file basis
|
||||
"noUnusedLocals": false,
|
||||
"sourceMap": true
|
||||
},
|
||||
"exclude": ["node_modules"],
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user