@alexlit/lint-kit 117.3.0 → 117.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/config-eslint/package.json +5 -9
- package/packages/config-eslint/plugins/no-await-in-promise.js +1 -1
- package/packages/config-eslint/utils/create-config.js +3 -3
- package/scripts/.config.sh +1 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/LICENSE +0 -19
- package/packages/config-eslint/node_modules/@eslint/eslintrc/README.md +0 -126
- package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/config-schema.js +0 -79
- package/packages/config-eslint/node_modules/@eslint/eslintrc/conf/environments.js +0 -215
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +0 -1143
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +0 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +0 -4371
- package/packages/config-eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +0 -1
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +0 -532
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +0 -510
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +0 -124
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +0 -145
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +0 -238
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js +0 -19
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +0 -225
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js +0 -1155
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js +0 -318
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index-universal.js +0 -29
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/index.js +0 -58
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js +0 -191
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +0 -135
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +0 -370
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +0 -63
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js +0 -96
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +0 -42
- package/packages/config-eslint/node_modules/@eslint/eslintrc/lib/shared/types.js +0 -149
- package/packages/config-eslint/node_modules/@eslint/eslintrc/package.json +0 -82
- package/packages/config-eslint/node_modules/@eslint/eslintrc/universal.js +0 -9
- package/packages/config-eslint/node_modules/ajv/.tonic_example.js +0 -20
- package/packages/config-eslint/node_modules/ajv/LICENSE +0 -22
- package/packages/config-eslint/node_modules/ajv/README.md +0 -1497
- package/packages/config-eslint/node_modules/ajv/dist/ajv.bundle.js +0 -7189
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js +0 -3
- package/packages/config-eslint/node_modules/ajv/dist/ajv.min.js.map +0 -1
- package/packages/config-eslint/node_modules/ajv/lib/ajv.d.ts +0 -397
- package/packages/config-eslint/node_modules/ajv/lib/ajv.js +0 -506
- package/packages/config-eslint/node_modules/ajv/lib/cache.js +0 -26
- package/packages/config-eslint/node_modules/ajv/lib/compile/async.js +0 -90
- package/packages/config-eslint/node_modules/ajv/lib/compile/equal.js +0 -5
- package/packages/config-eslint/node_modules/ajv/lib/compile/error_classes.js +0 -34
- package/packages/config-eslint/node_modules/ajv/lib/compile/formats.js +0 -142
- package/packages/config-eslint/node_modules/ajv/lib/compile/index.js +0 -387
- package/packages/config-eslint/node_modules/ajv/lib/compile/resolve.js +0 -270
- package/packages/config-eslint/node_modules/ajv/lib/compile/rules.js +0 -66
- package/packages/config-eslint/node_modules/ajv/lib/compile/schema_obj.js +0 -9
- package/packages/config-eslint/node_modules/ajv/lib/compile/ucs2length.js +0 -20
- package/packages/config-eslint/node_modules/ajv/lib/compile/util.js +0 -239
- package/packages/config-eslint/node_modules/ajv/lib/data.js +0 -49
- package/packages/config-eslint/node_modules/ajv/lib/definition_schema.js +0 -37
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limit.jst +0 -113
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitItems.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitLength.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/_limitProperties.jst +0 -12
- package/packages/config-eslint/node_modules/ajv/lib/dot/allOf.jst +0 -32
- package/packages/config-eslint/node_modules/ajv/lib/dot/anyOf.jst +0 -46
- package/packages/config-eslint/node_modules/ajv/lib/dot/coerce.def +0 -51
- package/packages/config-eslint/node_modules/ajv/lib/dot/comment.jst +0 -9
- package/packages/config-eslint/node_modules/ajv/lib/dot/const.jst +0 -11
- package/packages/config-eslint/node_modules/ajv/lib/dot/contains.jst +0 -55
- package/packages/config-eslint/node_modules/ajv/lib/dot/custom.jst +0 -191
- package/packages/config-eslint/node_modules/ajv/lib/dot/defaults.def +0 -47
- package/packages/config-eslint/node_modules/ajv/lib/dot/definitions.def +0 -203
- package/packages/config-eslint/node_modules/ajv/lib/dot/dependencies.jst +0 -79
- package/packages/config-eslint/node_modules/ajv/lib/dot/enum.jst +0 -30
- package/packages/config-eslint/node_modules/ajv/lib/dot/errors.def +0 -194
- package/packages/config-eslint/node_modules/ajv/lib/dot/format.jst +0 -106
- package/packages/config-eslint/node_modules/ajv/lib/dot/if.jst +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dot/items.jst +0 -98
- package/packages/config-eslint/node_modules/ajv/lib/dot/missing.def +0 -39
- package/packages/config-eslint/node_modules/ajv/lib/dot/multipleOf.jst +0 -22
- package/packages/config-eslint/node_modules/ajv/lib/dot/not.jst +0 -43
- package/packages/config-eslint/node_modules/ajv/lib/dot/oneOf.jst +0 -54
- package/packages/config-eslint/node_modules/ajv/lib/dot/pattern.jst +0 -14
- package/packages/config-eslint/node_modules/ajv/lib/dot/properties.jst +0 -245
- package/packages/config-eslint/node_modules/ajv/lib/dot/propertyNames.jst +0 -52
- package/packages/config-eslint/node_modules/ajv/lib/dot/ref.jst +0 -85
- package/packages/config-eslint/node_modules/ajv/lib/dot/required.jst +0 -108
- package/packages/config-eslint/node_modules/ajv/lib/dot/uniqueItems.jst +0 -62
- package/packages/config-eslint/node_modules/ajv/lib/dot/validate.jst +0 -276
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/README.md +0 -3
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limit.js +0 -163
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitItems.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitLength.js +0 -85
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/allOf.js +0 -42
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/anyOf.js +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/comment.js +0 -14
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/const.js +0 -56
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/contains.js +0 -81
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/custom.js +0 -228
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/dependencies.js +0 -168
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/enum.js +0 -66
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/format.js +0 -150
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/if.js +0 -103
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/index.js +0 -33
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/items.js +0 -140
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/multipleOf.js +0 -80
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/not.js +0 -84
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/oneOf.js +0 -73
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/pattern.js +0 -75
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/properties.js +0 -335
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/propertyNames.js +0 -81
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/ref.js +0 -124
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/required.js +0 -270
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -86
- package/packages/config-eslint/node_modules/ajv/lib/dotjs/validate.js +0 -482
- package/packages/config-eslint/node_modules/ajv/lib/keyword.js +0 -146
- package/packages/config-eslint/node_modules/ajv/lib/refs/data.json +0 -17
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-04.json +0 -149
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-06.json +0 -154
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-draft-07.json +0 -168
- package/packages/config-eslint/node_modules/ajv/lib/refs/json-schema-secure.json +0 -94
- package/packages/config-eslint/node_modules/ajv/package.json +0 -106
- package/packages/config-eslint/node_modules/ajv/scripts/.eslintrc.yml +0 -3
- package/packages/config-eslint/node_modules/ajv/scripts/bundle.js +0 -61
- package/packages/config-eslint/node_modules/ajv/scripts/compile-dots.js +0 -73
- package/packages/config-eslint/node_modules/ajv/scripts/info +0 -10
- package/packages/config-eslint/node_modules/ajv/scripts/prepare-tests +0 -12
- package/packages/config-eslint/node_modules/ajv/scripts/publish-built-version +0 -32
- package/packages/config-eslint/node_modules/ajv/scripts/travis-gh-pages +0 -23
- package/packages/config-eslint/node_modules/eslint-visitor-keys/LICENSE +0 -201
- package/packages/config-eslint/node_modules/eslint-visitor-keys/README.md +0 -105
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +0 -384
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +0 -27
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/index.d.ts +0 -16
- package/packages/config-eslint/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +0 -12
- package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/index.js +0 -65
- package/packages/config-eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js +0 -315
- package/packages/config-eslint/node_modules/eslint-visitor-keys/package.json +0 -74
- package/packages/config-eslint/node_modules/espree/LICENSE +0 -25
- package/packages/config-eslint/node_modules/espree/README.md +0 -244
- package/packages/config-eslint/node_modules/espree/dist/espree.cjs +0 -883
- package/packages/config-eslint/node_modules/espree/espree.js +0 -177
- package/packages/config-eslint/node_modules/espree/lib/espree.js +0 -349
- package/packages/config-eslint/node_modules/espree/lib/features.js +0 -27
- package/packages/config-eslint/node_modules/espree/lib/options.js +0 -123
- package/packages/config-eslint/node_modules/espree/lib/token-translator.js +0 -263
- package/packages/config-eslint/node_modules/espree/lib/version.js +0 -3
- package/packages/config-eslint/node_modules/espree/package.json +0 -86
- package/packages/config-eslint/node_modules/globals/globals.json +0 -1998
- package/packages/config-eslint/node_modules/globals/index.d.ts +0 -2077
- package/packages/config-eslint/node_modules/globals/index.js +0 -2
- package/packages/config-eslint/node_modules/globals/license +0 -9
- package/packages/config-eslint/node_modules/globals/package.json +0 -58
- package/packages/config-eslint/node_modules/globals/readme.md +0 -44
- package/packages/config-eslint/node_modules/json-schema-traverse/.eslintrc.yml +0 -27
- package/packages/config-eslint/node_modules/json-schema-traverse/.travis.yml +0 -8
- package/packages/config-eslint/node_modules/json-schema-traverse/LICENSE +0 -21
- package/packages/config-eslint/node_modules/json-schema-traverse/README.md +0 -83
- package/packages/config-eslint/node_modules/json-schema-traverse/index.js +0 -89
- package/packages/config-eslint/node_modules/json-schema-traverse/package.json +0 -43
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/.eslintrc.yml +0 -6
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/fixtures/schema.js +0 -125
- package/packages/config-eslint/node_modules/json-schema-traverse/spec/index.spec.js +0 -171
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexlit/config-eslint",
|
|
3
|
-
"version": "84.
|
|
3
|
+
"version": "84.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Eslint config",
|
|
6
6
|
"keywords": [
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"constants",
|
|
29
29
|
"dictionaries",
|
|
30
30
|
"index.js",
|
|
31
|
+
"legacy.js",
|
|
31
32
|
"plugins",
|
|
32
33
|
"utils"
|
|
33
34
|
],
|
|
@@ -41,8 +42,8 @@
|
|
|
41
42
|
"@eslint/eslintrc": "^3.1.0",
|
|
42
43
|
"@intlify/eslint-plugin-vue-i18n": "^2.0.0",
|
|
43
44
|
"@tanstack/eslint-plugin-query": "^5.35.6",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
45
|
-
"@typescript-eslint/parser": "^7.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
46
|
+
"@typescript-eslint/parser": "^7.10.0",
|
|
46
47
|
"eslint": "^8.57.0",
|
|
47
48
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
48
49
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"eslint-plugin-lit": "^1.13.0",
|
|
62
63
|
"eslint-plugin-lit-a11y": "^4.1.2",
|
|
63
64
|
"eslint-plugin-more": "^1.0.5",
|
|
64
|
-
"eslint-plugin-no-await-in-promise": "^
|
|
65
|
+
"eslint-plugin-no-await-in-promise": "^1.1.6",
|
|
65
66
|
"eslint-plugin-no-constructor-bind": "^2.0.4",
|
|
66
67
|
"eslint-plugin-no-explicit-type-exports": "^0.12.1",
|
|
67
68
|
"eslint-plugin-no-loops": "^0.3.0",
|
|
@@ -92,10 +93,5 @@
|
|
|
92
93
|
},
|
|
93
94
|
"engines": {
|
|
94
95
|
"node": ">=18.18"
|
|
95
|
-
},
|
|
96
|
-
"overrides": {
|
|
97
|
-
"eslint": "^8.57.0",
|
|
98
|
-
"eslint-plugin-array-func": "^4.0.0",
|
|
99
|
-
"eslint-plugin-vitest": "^0.5.4"
|
|
100
96
|
}
|
|
101
97
|
}
|
|
@@ -45,6 +45,9 @@ const DEFAULT_PLUGINS = {
|
|
|
45
45
|
/** @see [eslint-plugin-more](https://github.com/WebbyLab/eslint-plugin-more) */
|
|
46
46
|
more: true,
|
|
47
47
|
|
|
48
|
+
/** @see [eslint-plugin-no-await-in-promise](https://github.com/hugo-vrijswijk/eslint-plugin-no-await-in-promise/) */
|
|
49
|
+
'no-await-in-promise': true,
|
|
50
|
+
|
|
48
51
|
/** @see [eslint-plugin-no-constructor-bind](https://github.com/markalfred/eslint-plugin-no-constructor-bind) */
|
|
49
52
|
'no-constructor-bind': true,
|
|
50
53
|
|
|
@@ -125,9 +128,6 @@ const DEFAULT_PLUGINS = {
|
|
|
125
128
|
};
|
|
126
129
|
|
|
127
130
|
const OPTIONAL_PLUGINS = {
|
|
128
|
-
/** @see [eslint-plugin-no-await-in-promise](https://github.com/hugo-vrijswijk/eslint-plugin-no-await-in-promise/) */
|
|
129
|
-
'no-await-in-promise': false, // won't work
|
|
130
|
-
|
|
131
131
|
/** @see [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) */
|
|
132
132
|
node: false,
|
|
133
133
|
|
package/scripts/.config.sh
CHANGED
|
@@ -11,4 +11,4 @@ export CURRENT_DIR=${PWD##*/}
|
|
|
11
11
|
export CURRENT_PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
12
12
|
export CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
13
13
|
export MAIN_PACKAGE="@alexlit/lint-kit"
|
|
14
|
-
export SKIPED_PACKAGES='eslint,eslint-plugin-array-func'
|
|
14
|
+
export SKIPED_PACKAGES='eslint,eslint-plugin-array-func,eslint-plugin-no-await-in-promise'
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
THE SOFTWARE.
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
# ESLintRC Library
|
|
2
|
-
|
|
3
|
-
This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs.
|
|
4
|
-
|
|
5
|
-
**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
You can install the package as follows:
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
npm install @eslint/eslintrc --save-dev
|
|
13
|
-
|
|
14
|
-
# or
|
|
15
|
-
|
|
16
|
-
yarn add @eslint/eslintrc -D
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Usage (ESM)
|
|
20
|
-
|
|
21
|
-
The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file:
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
25
|
-
import js from "@eslint/js";
|
|
26
|
-
import path from "path";
|
|
27
|
-
import { fileURLToPath } from "url";
|
|
28
|
-
|
|
29
|
-
// mimic CommonJS variables -- not needed if using CommonJS
|
|
30
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
31
|
-
const __dirname = path.dirname(__filename);
|
|
32
|
-
|
|
33
|
-
const compat = new FlatCompat({
|
|
34
|
-
baseDirectory: __dirname, // optional; default: process.cwd()
|
|
35
|
-
resolvePluginsRelativeTo: __dirname, // optional
|
|
36
|
-
recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended"
|
|
37
|
-
allConfig: js.configs.all, // optional unless you're using "eslint:all"
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
export default [
|
|
41
|
-
|
|
42
|
-
// mimic ESLintRC-style extends
|
|
43
|
-
...compat.extends("standard", "example"),
|
|
44
|
-
|
|
45
|
-
// mimic environments
|
|
46
|
-
...compat.env({
|
|
47
|
-
es2020: true,
|
|
48
|
-
node: true
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
// mimic plugins
|
|
52
|
-
...compat.plugins("airbnb", "react"),
|
|
53
|
-
|
|
54
|
-
// translate an entire config
|
|
55
|
-
...compat.config({
|
|
56
|
-
plugins: ["airbnb", "react"],
|
|
57
|
-
extends: "standard",
|
|
58
|
-
env: {
|
|
59
|
-
es2020: true,
|
|
60
|
-
node: true
|
|
61
|
-
},
|
|
62
|
-
rules: {
|
|
63
|
-
semi: "error"
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
];
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Usage (CommonJS)
|
|
70
|
-
|
|
71
|
-
Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file:
|
|
72
|
-
|
|
73
|
-
```js
|
|
74
|
-
const { FlatCompat } = require("@eslint/eslintrc");
|
|
75
|
-
const js = require("@eslint/js");
|
|
76
|
-
|
|
77
|
-
const compat = new FlatCompat({
|
|
78
|
-
baseDirectory: __dirname, // optional; default: process.cwd()
|
|
79
|
-
resolvePluginsRelativeTo: __dirname, // optional
|
|
80
|
-
recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended"
|
|
81
|
-
allConfig: js.configs.all, // optional unless using "eslint:all"
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
module.exports = [
|
|
85
|
-
|
|
86
|
-
// mimic ESLintRC-style extends
|
|
87
|
-
...compat.extends("standard", "example"),
|
|
88
|
-
|
|
89
|
-
// mimic environments
|
|
90
|
-
...compat.env({
|
|
91
|
-
es2020: true,
|
|
92
|
-
node: true
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
// mimic plugins
|
|
96
|
-
...compat.plugins("airbnb", "react"),
|
|
97
|
-
|
|
98
|
-
// translate an entire config
|
|
99
|
-
...compat.config({
|
|
100
|
-
plugins: ["airbnb", "react"],
|
|
101
|
-
extends: "standard",
|
|
102
|
-
env: {
|
|
103
|
-
es2020: true,
|
|
104
|
-
node: true
|
|
105
|
-
},
|
|
106
|
-
rules: {
|
|
107
|
-
semi: "error"
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
];
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Troubleshooting
|
|
114
|
-
|
|
115
|
-
**TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor**
|
|
116
|
-
|
|
117
|
-
The `recommendedConfig` option is required when any config uses `eslint:recommended`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:recommended` config.
|
|
118
|
-
|
|
119
|
-
**TypeError: Missing parameter 'allConfig' in FlatCompat constructor**
|
|
120
|
-
|
|
121
|
-
The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## License
|
|
125
|
-
|
|
126
|
-
MIT License
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines a schema for configs.
|
|
3
|
-
* @author Sylvan Mably
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const baseConfigProperties = {
|
|
7
|
-
$schema: { type: "string" },
|
|
8
|
-
env: { type: "object" },
|
|
9
|
-
extends: { $ref: "#/definitions/stringOrStrings" },
|
|
10
|
-
globals: { type: "object" },
|
|
11
|
-
overrides: {
|
|
12
|
-
type: "array",
|
|
13
|
-
items: { $ref: "#/definitions/overrideConfig" },
|
|
14
|
-
additionalItems: false
|
|
15
|
-
},
|
|
16
|
-
parser: { type: ["string", "null"] },
|
|
17
|
-
parserOptions: { type: "object" },
|
|
18
|
-
plugins: { type: "array" },
|
|
19
|
-
processor: { type: "string" },
|
|
20
|
-
rules: { type: "object" },
|
|
21
|
-
settings: { type: "object" },
|
|
22
|
-
noInlineConfig: { type: "boolean" },
|
|
23
|
-
reportUnusedDisableDirectives: { type: "boolean" },
|
|
24
|
-
|
|
25
|
-
ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const configSchema = {
|
|
29
|
-
definitions: {
|
|
30
|
-
stringOrStrings: {
|
|
31
|
-
oneOf: [
|
|
32
|
-
{ type: "string" },
|
|
33
|
-
{
|
|
34
|
-
type: "array",
|
|
35
|
-
items: { type: "string" },
|
|
36
|
-
additionalItems: false
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
stringOrStringsRequired: {
|
|
41
|
-
oneOf: [
|
|
42
|
-
{ type: "string" },
|
|
43
|
-
{
|
|
44
|
-
type: "array",
|
|
45
|
-
items: { type: "string" },
|
|
46
|
-
additionalItems: false,
|
|
47
|
-
minItems: 1
|
|
48
|
-
}
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
// Config at top-level.
|
|
53
|
-
objectConfig: {
|
|
54
|
-
type: "object",
|
|
55
|
-
properties: {
|
|
56
|
-
root: { type: "boolean" },
|
|
57
|
-
ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
|
|
58
|
-
...baseConfigProperties
|
|
59
|
-
},
|
|
60
|
-
additionalProperties: false
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
// Config in `overrides`.
|
|
64
|
-
overrideConfig: {
|
|
65
|
-
type: "object",
|
|
66
|
-
properties: {
|
|
67
|
-
excludedFiles: { $ref: "#/definitions/stringOrStrings" },
|
|
68
|
-
files: { $ref: "#/definitions/stringOrStringsRequired" },
|
|
69
|
-
...baseConfigProperties
|
|
70
|
-
},
|
|
71
|
-
required: ["files"],
|
|
72
|
-
additionalProperties: false
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
$ref: "#/definitions/objectConfig"
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export default configSchema;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Defines environment settings and globals.
|
|
3
|
-
* @author Elan Shanker
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
//------------------------------------------------------------------------------
|
|
7
|
-
// Requirements
|
|
8
|
-
//------------------------------------------------------------------------------
|
|
9
|
-
|
|
10
|
-
import globals from "globals";
|
|
11
|
-
|
|
12
|
-
//------------------------------------------------------------------------------
|
|
13
|
-
// Helpers
|
|
14
|
-
//------------------------------------------------------------------------------
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Get the object that has difference.
|
|
18
|
-
* @param {Record<string,boolean>} current The newer object.
|
|
19
|
-
* @param {Record<string,boolean>} prev The older object.
|
|
20
|
-
* @returns {Record<string,boolean>} The difference object.
|
|
21
|
-
*/
|
|
22
|
-
function getDiff(current, prev) {
|
|
23
|
-
const retv = {};
|
|
24
|
-
|
|
25
|
-
for (const [key, value] of Object.entries(current)) {
|
|
26
|
-
if (!Object.hasOwnProperty.call(prev, key)) {
|
|
27
|
-
retv[key] = value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return retv;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const newGlobals2015 = getDiff(globals.es2015, globals.es5); // 19 variables such as Promise, Map, ...
|
|
35
|
-
const newGlobals2017 = {
|
|
36
|
-
Atomics: false,
|
|
37
|
-
SharedArrayBuffer: false
|
|
38
|
-
};
|
|
39
|
-
const newGlobals2020 = {
|
|
40
|
-
BigInt: false,
|
|
41
|
-
BigInt64Array: false,
|
|
42
|
-
BigUint64Array: false,
|
|
43
|
-
globalThis: false
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const newGlobals2021 = {
|
|
47
|
-
AggregateError: false,
|
|
48
|
-
FinalizationRegistry: false,
|
|
49
|
-
WeakRef: false
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
//------------------------------------------------------------------------------
|
|
53
|
-
// Public Interface
|
|
54
|
-
//------------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
/** @type {Map<string, import("../lib/shared/types").Environment>} */
|
|
57
|
-
export default new Map(Object.entries({
|
|
58
|
-
|
|
59
|
-
// Language
|
|
60
|
-
builtin: {
|
|
61
|
-
globals: globals.es5
|
|
62
|
-
},
|
|
63
|
-
es6: {
|
|
64
|
-
globals: newGlobals2015,
|
|
65
|
-
parserOptions: {
|
|
66
|
-
ecmaVersion: 6
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
es2015: {
|
|
70
|
-
globals: newGlobals2015,
|
|
71
|
-
parserOptions: {
|
|
72
|
-
ecmaVersion: 6
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
es2016: {
|
|
76
|
-
globals: newGlobals2015,
|
|
77
|
-
parserOptions: {
|
|
78
|
-
ecmaVersion: 7
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
es2017: {
|
|
82
|
-
globals: { ...newGlobals2015, ...newGlobals2017 },
|
|
83
|
-
parserOptions: {
|
|
84
|
-
ecmaVersion: 8
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
es2018: {
|
|
88
|
-
globals: { ...newGlobals2015, ...newGlobals2017 },
|
|
89
|
-
parserOptions: {
|
|
90
|
-
ecmaVersion: 9
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
es2019: {
|
|
94
|
-
globals: { ...newGlobals2015, ...newGlobals2017 },
|
|
95
|
-
parserOptions: {
|
|
96
|
-
ecmaVersion: 10
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
es2020: {
|
|
100
|
-
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
|
|
101
|
-
parserOptions: {
|
|
102
|
-
ecmaVersion: 11
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
es2021: {
|
|
106
|
-
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
|
107
|
-
parserOptions: {
|
|
108
|
-
ecmaVersion: 12
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
es2022: {
|
|
112
|
-
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
|
113
|
-
parserOptions: {
|
|
114
|
-
ecmaVersion: 13
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
es2023: {
|
|
118
|
-
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
|
119
|
-
parserOptions: {
|
|
120
|
-
ecmaVersion: 14
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
es2024: {
|
|
124
|
-
globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
|
|
125
|
-
parserOptions: {
|
|
126
|
-
ecmaVersion: 15
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
// Platforms
|
|
131
|
-
browser: {
|
|
132
|
-
globals: globals.browser
|
|
133
|
-
},
|
|
134
|
-
node: {
|
|
135
|
-
globals: globals.node,
|
|
136
|
-
parserOptions: {
|
|
137
|
-
ecmaFeatures: {
|
|
138
|
-
globalReturn: true
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
"shared-node-browser": {
|
|
143
|
-
globals: globals["shared-node-browser"]
|
|
144
|
-
},
|
|
145
|
-
worker: {
|
|
146
|
-
globals: globals.worker
|
|
147
|
-
},
|
|
148
|
-
serviceworker: {
|
|
149
|
-
globals: globals.serviceworker
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
// Frameworks
|
|
153
|
-
commonjs: {
|
|
154
|
-
globals: globals.commonjs,
|
|
155
|
-
parserOptions: {
|
|
156
|
-
ecmaFeatures: {
|
|
157
|
-
globalReturn: true
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
amd: {
|
|
162
|
-
globals: globals.amd
|
|
163
|
-
},
|
|
164
|
-
mocha: {
|
|
165
|
-
globals: globals.mocha
|
|
166
|
-
},
|
|
167
|
-
jasmine: {
|
|
168
|
-
globals: globals.jasmine
|
|
169
|
-
},
|
|
170
|
-
jest: {
|
|
171
|
-
globals: globals.jest
|
|
172
|
-
},
|
|
173
|
-
phantomjs: {
|
|
174
|
-
globals: globals.phantomjs
|
|
175
|
-
},
|
|
176
|
-
jquery: {
|
|
177
|
-
globals: globals.jquery
|
|
178
|
-
},
|
|
179
|
-
qunit: {
|
|
180
|
-
globals: globals.qunit
|
|
181
|
-
},
|
|
182
|
-
prototypejs: {
|
|
183
|
-
globals: globals.prototypejs
|
|
184
|
-
},
|
|
185
|
-
shelljs: {
|
|
186
|
-
globals: globals.shelljs
|
|
187
|
-
},
|
|
188
|
-
meteor: {
|
|
189
|
-
globals: globals.meteor
|
|
190
|
-
},
|
|
191
|
-
mongo: {
|
|
192
|
-
globals: globals.mongo
|
|
193
|
-
},
|
|
194
|
-
protractor: {
|
|
195
|
-
globals: globals.protractor
|
|
196
|
-
},
|
|
197
|
-
applescript: {
|
|
198
|
-
globals: globals.applescript
|
|
199
|
-
},
|
|
200
|
-
nashorn: {
|
|
201
|
-
globals: globals.nashorn
|
|
202
|
-
},
|
|
203
|
-
atomtest: {
|
|
204
|
-
globals: globals.atomtest
|
|
205
|
-
},
|
|
206
|
-
embertest: {
|
|
207
|
-
globals: globals.embertest
|
|
208
|
-
},
|
|
209
|
-
webextensions: {
|
|
210
|
-
globals: globals.webextensions
|
|
211
|
-
},
|
|
212
|
-
greasemonkey: {
|
|
213
|
-
globals: globals.greasemonkey
|
|
214
|
-
}
|
|
215
|
-
}));
|