Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move all and recommended configs into package. (#16844)
* feat: Move all and recommended configs into package. Relocates the "eslint:all" and "eslint:recommended" configs into the @eslint/js package so they can be referenced from there instead of as strings. Fixes #16537 * Update tools/update-eslint-all.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update package.json Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update tools/update-eslint-all.js Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/package.json Co-authored-by: Mark Friedrich <exodus4d@users.noreply.github.com> * Update package.json Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/README.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/LICENSE Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/package.json Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/README.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/README.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update packages/js/README.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Update docs/src/use/configure/configuration-files-new.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * Incorporate feedback --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Co-authored-by: Mark Friedrich <exodus4d@users.noreply.github.com>
- Loading branch information
1 parent
f9f195e
commit c8c0c71
Showing
17 changed files
with
482 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright OpenJS Foundation and other contributors, <www.openjsf.org> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js) | ||
|
||
# ESLint JavaScript Plugin | ||
|
||
[Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat) | ||
|
||
The beginnings of separating out JavaScript-specific functionality from ESLint. | ||
|
||
Right now, this plugin contains two configurations: | ||
|
||
* `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`) | ||
* `all` - enables all ESLint rules (the replacement for `"eslint:all"`) | ||
|
||
## Installation | ||
|
||
```shell | ||
npm install @eslint/js -D | ||
``` | ||
|
||
## Usage | ||
|
||
Use in your `eslint.config.js` file anytime you want to extend one of the configs: | ||
|
||
```js | ||
import js from "@eslint/js"; | ||
|
||
export default [ | ||
|
||
// apply recommended rules to JS files | ||
{ | ||
files: ["**/*.js"], | ||
rules: js.configs.recommended.rules | ||
}, | ||
|
||
// apply recommended rules to JS files with an override | ||
{ | ||
files: ["**/*.js"], | ||
rules: { | ||
...js.configs.recommended.rules, | ||
"no-unused-vars": "warn" | ||
} | ||
}, | ||
|
||
// apply all rules to JS files | ||
{ | ||
files: ["**/*.js"], | ||
rules: { | ||
...js.configs.all.rules, | ||
"no-unused-vars": "warn" | ||
} | ||
} | ||
] | ||
``` | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "@eslint/js", | ||
"version": "8.33.0", | ||
"description": "ESLint JavaScript language implementation", | ||
"main": "./src/index.js", | ||
"scripts": { | ||
}, | ||
"files": [ | ||
"LICENSE", | ||
"README.md", | ||
"src" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/eslint/eslint.git", | ||
"directory": "packages/js" | ||
}, | ||
"homepage": "https://eslint.org", | ||
"bugs": "https://github.com/eslint/eslint/issues/", | ||
"keywords": [ | ||
"javascript", | ||
"eslint-plugin", | ||
"eslint" | ||
], | ||
"license": "MIT", | ||
"engines": { | ||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" | ||
} | ||
} |
Oops, something went wrong.