mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Basic noop rule for ReactForgetDiagnostics
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:eslint-plugin/recommended",
|
||||
"plugin:node/recommended",
|
||||
],
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["tests/**/*.js"],
|
||||
env: { mocha: true },
|
||||
},
|
||||
],
|
||||
};
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { RuleTester as ESLintTester } from "eslint";
|
||||
import ReactForgetDiagnostics from "../src/rules/ReactForgetDiagnostics";
|
||||
|
||||
const tests = {
|
||||
valid: [{ code: "" }],
|
||||
invalid: [],
|
||||
};
|
||||
|
||||
const eslintTester = new ESLintTester();
|
||||
eslintTester.run("react-forget-diagnostics", ReactForgetDiagnostics, tests);
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
module.exports = { presets: ["@babel/preset-env"] };
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* @fileoverview ESLint plugin for React Forget
|
||||
* @author
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const requireIndex = require("requireindex");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Plugin Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// import all rules in lib/rules
|
||||
module.exports.rules = requireIndex(__dirname + "/rules");
|
||||
|
||||
|
||||
|
||||
@@ -14,18 +14,19 @@
|
||||
"lint": "npm-run-all \"lint:*\"",
|
||||
"lint:eslint-docs": "npm-run-all \"update:eslint-docs -- --check\"",
|
||||
"lint:js": "eslint .",
|
||||
"test": "mocha tests --recursive",
|
||||
"test": "jest",
|
||||
"update:eslint-docs": "eslint-doc-generator"
|
||||
},
|
||||
"dependencies": {
|
||||
"requireindex": "^1.2.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/preset-env": "^7.22.4",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"babel-jest": "^29.0.3",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-doc-generator": "^1.0.0",
|
||||
"eslint-plugin-eslint-plugin": "^5.0.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"mocha": "^10.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"npm-run-all": "^4.1.5"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import ReactForgetDiagnostics from "./rules/ReactForgetDiagnostics";
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
"react-forget-diagnoatics": ReactForgetDiagnostics,
|
||||
},
|
||||
};
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
export default {
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description: "Surfaces diagnostics from React Forget",
|
||||
recommended: true,
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
return {};
|
||||
},
|
||||
};
|
||||
+1441
-225
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user