mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
Remove unused dep
Bug: 397586315 Change-Id: I4ed899c87a7e158126ea3cf83e4407b93a1a899b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6426042 Reviewed-by: Danil Somsikov <dsv@chromium.org> Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
eeb255910b
commit
9692bed9e0
-10
@@ -3564,16 +3564,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-rulesdir": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://npm.skia.org/chrome-devtools/eslint-plugin-rulesdir/-/eslint-plugin-rulesdir-0.2.2.tgz",
|
||||
"integrity": "sha512-qhBtmrWgehAIQeMDJ+Q+PnOz1DWUZMPeVrI0wE9NZtnpIMFUfh3aPKFYt2saeMSemZRrvUtjWfYwepsC8X+mjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://npm.skia.org/chrome-devtools/eslint-scope/-/eslint-scope-8.2.0.tgz",
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
!.eslintrc.js
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const PACKAGE_NAME = require('./package').name;
|
||||
|
||||
const SYMLINK_LOCATION = path.join(__dirname, 'node_modules', PACKAGE_NAME);
|
||||
|
||||
// Symlink node_modules/{package name} to this directory
|
||||
// so that ESLint resolves this plugin name correctly.
|
||||
// (Yes, this plugin still has to hack node_modules to bootstrap itself.)
|
||||
if (!fs.existsSync(SYMLINK_LOCATION)) {
|
||||
fs.symlinkSync(__dirname, SYMLINK_LOCATION);
|
||||
}
|
||||
|
||||
require('.').RULES_DIR = [path.resolve('fake-rule-dir-one'), path.resolve('fake-rule-dir-two'), path.resolve('fake-rule-dir-three')];
|
||||
|
||||
module.exports = {
|
||||
extends: 'airbnb-base',
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
},
|
||||
rules: {
|
||||
'global-require': 'off',
|
||||
'import/no-dynamic-require': 'off',
|
||||
'rulesdir/fake-rule': 'error',
|
||||
'rulesdir/another-fake-rule': 'error',
|
||||
'rulesdir/yet-another-fake-rule': 'error',
|
||||
},
|
||||
plugins: [PACKAGE_NAME],
|
||||
};
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const PACKAGE_NAME = require('./package').name;
|
||||
|
||||
const SYMLINK_LOCATION = path.join(__dirname, 'node_modules', PACKAGE_NAME);
|
||||
|
||||
// Symlink node_modules/{package name} to this directory
|
||||
// so that ESLint resolves this plugin name correctly.
|
||||
// (Yes, this plugin still has to hack node_modules to bootstrap itself.)
|
||||
if (!fs.existsSync(SYMLINK_LOCATION)) {
|
||||
fs.symlinkSync(__dirname, SYMLINK_LOCATION);
|
||||
}
|
||||
|
||||
require('.').RULES_DIR = path.resolve('fake-rule-dir-one');
|
||||
|
||||
module.exports = {
|
||||
extends: 'airbnb-base',
|
||||
parserOptions: {
|
||||
sourceType: 'script',
|
||||
},
|
||||
rules: {
|
||||
'global-require': 'off',
|
||||
'import/no-dynamic-require': 'off',
|
||||
'rulesdir/fake-rule': 'error',
|
||||
},
|
||||
plugins: [PACKAGE_NAME],
|
||||
};
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## v0.2.2 (2022-12-17)
|
||||
|
||||
- Support loading `.ts` rules from a directory
|
||||
|
||||
## Previous versions
|
||||
|
||||
See the [git history](https://github.com/not-an-aardvark/eslint-plugin-rulesdir).
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright © 2017 Teddy Katz
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the “Software”), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
# eslint-plugin-rulesdir
|
||||
|
||||
Allows a local directory containing ESLint rules directory to be easily used. This is a substitute for the `--rulesdir` option that can be used without a command-line flag.
|
||||
|
||||
**Experimental:** This plugin is currently a proof-of-concept. Its API is likely to change in the future.
|
||||
|
||||
## Installation
|
||||
|
||||
You'll first need to install [ESLint](http://eslint.org):
|
||||
|
||||
```
|
||||
$ npm i eslint --save-dev
|
||||
```
|
||||
|
||||
Next, install `eslint-plugin-rulesdir`:
|
||||
|
||||
```
|
||||
$ npm install eslint-plugin-rulesdir --save-dev
|
||||
```
|
||||
|
||||
**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-rulesdir` globally.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this plugin, you must load it manually first and set its `RULES_DIR` property to a path, or an array of paths. The paths are resolved from the current working directory, and indicates where you would like the plugin to load your rules from. This is easiest if you use a JavaScript config file (`.eslintrc.js`), and use a local installation of ESLint.
|
||||
|
||||
```js
|
||||
// .eslintrc.js
|
||||
const rulesDirPlugin = require('eslint-plugin-rulesdir');
|
||||
rulesDirPlugin.RULES_DIR = 'tools/eslint-rules'; // (an example folder where your rules might be stored)
|
||||
|
||||
// You can also provide an array if you have multiple folders with rules in:
|
||||
rulesDirPlugin.RULES_DIR = ['tools/eslint-rules', 'tools/other-eslint-rules'];
|
||||
```
|
||||
|
||||
Then you should add `rulesdir` to the plugins section of your `.eslintrc.js` file.
|
||||
|
||||
```js
|
||||
{
|
||||
plugins: [
|
||||
'rulesdir'
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Finally, you can configure your local rules, prefixed with `rulesdir/`.
|
||||
|
||||
```js
|
||||
{
|
||||
rules: {
|
||||
//
|
||||
'rulesdir/my-internal-foo-rule': 'error',
|
||||
'rulesdir/my-internal-bar-rule': ['warn', 2]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
All of the rules from your configured rules directory will be available. In this example, we assumed there were rule files in `tools/eslint-rules/my-internal-foo-rule.js` and `tools/eslint-rules/my-internal-bar-rule.js`.
|
||||
|
||||
## Prior Art
|
||||
|
||||
* [`eslint-plugin-local-rules`](https://github.com/cletusw/eslint-plugin-local-rules)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/not-an-aardvark/eslint-plugin-rulesdir/blob/master/LICENSE.md)
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// This rule doesn't do anything.
|
||||
// it only exists to make sure a rule is found and the plugin is working.
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = { create: () => ({}) };
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// This rule doesn't do anything.
|
||||
// it only exists to make sure a rule is found and the plugin is working.
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = { create: () => ({}) };
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
// This rule doesn't do anything.
|
||||
// it only exists to make sure a rule is found and the plugin is working.
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = { create: () => ({}) };
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Allows a local ESLint rules directory to be used without a command-line flag
|
||||
* @author Teddy Katz
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Plugin Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const cache = {};
|
||||
|
||||
const ruleExtensions = new Set(['.js', '.cjs', '.mjs', '.ts', '.cts', '.mts']);
|
||||
|
||||
module.exports = {
|
||||
get rules() {
|
||||
const RULES_DIR = module.exports.RULES_DIR;
|
||||
if (typeof module.exports.RULES_DIR !== 'string' && !Array.isArray(RULES_DIR)) {
|
||||
throw new Error('To use eslint-plugin-rulesdir, you must load it beforehand and set the `RULES_DIR` property on the module to a string or an array of strings.');
|
||||
}
|
||||
const cacheKey = JSON.stringify(RULES_DIR);
|
||||
if (!cache[cacheKey]) {
|
||||
const rules = Array.isArray(RULES_DIR) ? RULES_DIR : [RULES_DIR];
|
||||
const rulesObject = {};
|
||||
rules.forEach((rulesDir) => {
|
||||
fs.readdirSync(rulesDir)
|
||||
.filter(filename => ruleExtensions.has(path.extname(filename)))
|
||||
.map(filename => path.resolve(rulesDir, filename))
|
||||
.forEach((absolutePath) => {
|
||||
const ruleName = path.basename(absolutePath, path.extname(absolutePath));
|
||||
if (rulesObject[ruleName]) {
|
||||
throw new Error(`eslint-plugin-rulesdir found two rules with the same name: ${ruleName}`);
|
||||
}
|
||||
rulesObject[ruleName] = require(absolutePath);
|
||||
});
|
||||
});
|
||||
cache[cacheKey] = rulesObject;
|
||||
}
|
||||
return cache[cacheKey];
|
||||
},
|
||||
};
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"name": "eslint-plugin-rulesdir",
|
||||
"version": "0.2.2",
|
||||
"description": "Allows a local ESLint rules directory to be used without a command-line flag",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"eslintplugin",
|
||||
"eslint-plugin"
|
||||
],
|
||||
"author": "Teddy Katz",
|
||||
"scripts": {
|
||||
"test": "npm run lint-single-rulesdir && npm run lint-multiple-rulesdir",
|
||||
"lint-single-rulesdir": "eslint --config .eslintrc-single-rulesdir.js *.js **/*.js",
|
||||
"lint-multiple-rulesdir": "eslint --config .eslintrc-multiple-rulesdir.js *.js **/*.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/not-an-aardvark/eslint-plugin-rulesdir.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": ">=3",
|
||||
"eslint-config-airbnb-base": "^11.2.0",
|
||||
"eslint-plugin-import": "^2.6.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
}
|
||||
Generated
-11
@@ -38,7 +38,6 @@
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-jsdoc": "50.6.1",
|
||||
"eslint-plugin-mocha": "10.5.0",
|
||||
"eslint-plugin-rulesdir": "0.2.2",
|
||||
"glob": "7.1.7",
|
||||
"globals": "16.0.0",
|
||||
"karma": "6.4.0",
|
||||
@@ -4413,16 +4412,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-rulesdir": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://npm.skia.org/chrome-devtools/eslint-plugin-rulesdir/-/eslint-plugin-rulesdir-0.2.2.tgz",
|
||||
"integrity": "sha512-qhBtmrWgehAIQeMDJ+Q+PnOz1DWUZMPeVrI0wE9NZtnpIMFUfh3aPKFYt2saeMSemZRrvUtjWfYwepsC8X+mjQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-scope": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://npm.skia.org/chrome-devtools/eslint-scope/-/eslint-scope-8.2.0.tgz",
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
"eslint-plugin-import": "2.31.0",
|
||||
"eslint-plugin-jsdoc": "50.6.1",
|
||||
"eslint-plugin-mocha": "10.5.0",
|
||||
"eslint-plugin-rulesdir": "0.2.2",
|
||||
"glob": "7.1.7",
|
||||
"globals": "16.0.0",
|
||||
"karma": "6.4.0",
|
||||
|
||||
Reference in New Issue
Block a user