@futagoza/eslint-config-core 15.4.0 → 17.0.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/README.md +68 -43
- package/index.js +48 -9
- package/package.json +7 -2
- package/rules/layout.js +30 -0
- package/rules/problem.js +507 -0
- package/rules/style.js +1023 -0
- package/rules/suggestion.js +1055 -0
- package/best-practices.js +0 -579
- package/deprecated.js +0 -176
- package/ecmascript-6.js +0 -239
- package/internal/config.js +0 -15
- package/internal/index.js +0 -3
- package/possible-errors.js +0 -335
- package/stylistic-issues.js +0 -763
- package/variables.js +0 -100
package/README.md
CHANGED
|
@@ -1,43 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
> This package contains configuration files for ESLint v10+<br>
|
|
2
|
+
|
|
3
|
+
These are configuration files for ESLint that are mostly extended upon by my other ESLint configurations.
|
|
4
|
+
|
|
5
|
+
Most of the rules set in these files are from the core set of built-in ESLint rules, with the rest from the `@stylistic` plugin
|
|
6
|
+
|
|
7
|
+
## installation
|
|
8
|
+
|
|
9
|
+
```console
|
|
10
|
+
$ npm i --save-dev @futagoza/eslint-config-core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## usage
|
|
14
|
+
|
|
15
|
+
Put the following into your eslint configuration file:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { defineConfig } from "eslint/config"
|
|
19
|
+
import coreConfig from "@futagoza/eslint-config-core"
|
|
20
|
+
|
|
21
|
+
// Used alongside other configurations:
|
|
22
|
+
export default [
|
|
23
|
+
|
|
24
|
+
// ...
|
|
25
|
+
|
|
26
|
+
coreConfig,
|
|
27
|
+
|
|
28
|
+
// ...
|
|
29
|
+
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
// Used as base configuration for other configurations:
|
|
33
|
+
export default defineConfig(
|
|
34
|
+
{
|
|
35
|
+
|
|
36
|
+
// ...
|
|
37
|
+
|
|
38
|
+
extends: [ coreConfig ],
|
|
39
|
+
|
|
40
|
+
// ...
|
|
41
|
+
|
|
42
|
+
},
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
// direct access to unprocessed config object
|
|
46
|
+
import { config } from "@futagoza/eslint-config-core"
|
|
47
|
+
|
|
48
|
+
// direct access to core ESLint rules used in this config
|
|
49
|
+
import { EslintRules } from "@futagoza/eslint-config-core"
|
|
50
|
+
|
|
51
|
+
// or direct access to ALL rules (ESLint + @stylistic) used in this config
|
|
52
|
+
import { ConfigRules } from "@futagoza/eslint-config-core"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## configurations
|
|
56
|
+
|
|
57
|
+
A list of usable configurations:
|
|
58
|
+
|
|
59
|
+
- __`@futagoza/eslint-config-core`__ (_default_, extends the below auto-generated configurations)
|
|
60
|
+
- __`@futagoza/eslint-config-core/rules/layout.js`__
|
|
61
|
+
- __`@futagoza/eslint-config-core/rules/problem.js`__
|
|
62
|
+
- __`@futagoza/eslint-config-core/rules/style.js`__
|
|
63
|
+
- __`@futagoza/eslint-config-core/rules/suggestion.js`__
|
|
64
|
+
|
|
65
|
+
## license
|
|
66
|
+
|
|
67
|
+
Copyright © 2017+ Futago-za Ryuu<br>
|
|
68
|
+
Released under the MIT License, [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)
|
package/index.js
CHANGED
|
@@ -1,16 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineConfig } from "eslint/config"
|
|
2
|
+
import { config as LayoutConfig } from "./rules/layout.js"
|
|
3
|
+
import { config as ProblemConfig } from "./rules/problem.js"
|
|
4
|
+
import { config as SuggestionConfig } from "./rules/suggestion.js"
|
|
5
|
+
import { config as StyleConfig } from "./rules/style.js"
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
/**
|
|
8
|
+
* ESLint's built-in rules
|
|
9
|
+
*/
|
|
10
|
+
export const EslintRules = {
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
...LayoutConfig.rules,
|
|
13
|
+
...ProblemConfig.rules,
|
|
14
|
+
...SuggestionConfig.rules,
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
"./best-practices.js",
|
|
9
|
-
"./stylistic-issues.js",
|
|
10
|
-
"./variables.js",
|
|
16
|
+
}
|
|
11
17
|
|
|
18
|
+
/**
|
|
19
|
+
* ESLint's built-in rules + `@stylistic` rules
|
|
20
|
+
*/
|
|
21
|
+
export const ConfigRules = {
|
|
22
|
+
|
|
23
|
+
...EslintRules,
|
|
24
|
+
...StyleConfig.rules,
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Raw config for `@futagoza/eslint-config-core`
|
|
30
|
+
*
|
|
31
|
+
* **NOTE:** Will not work properly with ESLint until passed through `require( "eslint/config" ).defineConfig`
|
|
32
|
+
*/
|
|
33
|
+
export const config = {
|
|
34
|
+
|
|
35
|
+
name: "@futagoza/eslint-config-core",
|
|
36
|
+
|
|
37
|
+
extends: [
|
|
38
|
+
LayoutConfig,
|
|
39
|
+
ProblemConfig,
|
|
40
|
+
SuggestionConfig,
|
|
41
|
+
StyleConfig,
|
|
12
42
|
],
|
|
13
43
|
|
|
14
|
-
|
|
44
|
+
linterOptions: {
|
|
45
|
+
|
|
46
|
+
reportUnusedDisableDirectives: "warn",
|
|
47
|
+
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
}
|
|
15
51
|
|
|
16
|
-
|
|
52
|
+
/**
|
|
53
|
+
* ESLint ready config for `@futagoza/eslint-config-core`
|
|
54
|
+
*/
|
|
55
|
+
export default defineConfig( config )
|
package/package.json
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futagoza/eslint-config-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.0",
|
|
4
4
|
"description": "Futago-za Ryuu's basic ESLint configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
7
7
|
"configuration",
|
|
8
|
+
"lint",
|
|
8
9
|
"style"
|
|
9
10
|
],
|
|
10
11
|
"repository": "https://github.com/futagoza/eslint-config-futagozaryuu/tree/master/packages/@futagoza/eslint-config-core",
|
|
11
12
|
"license": "MIT",
|
|
12
13
|
"author": "Futago-za Ryuu",
|
|
13
14
|
"main": "index.js",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@stylistic/eslint-plugin": "6.0.0-beta.5"
|
|
18
|
+
},
|
|
14
19
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
20
|
+
"node": ">=20.0.0"
|
|
16
21
|
}
|
|
17
22
|
}
|
package/rules/layout.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// WARNING: AUTO-GENERATED USING https://raw.githubusercontent.com/eslint/eslint/main/docs/src/_data/rules.json
|
|
3
|
+
//
|
|
4
|
+
// These rules care about how the code looks rather than how it executes
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Raw config for `@futagoza/eslint-config-core/rules/layout.js`
|
|
9
|
+
*/
|
|
10
|
+
export const config = {
|
|
11
|
+
|
|
12
|
+
name: "@futagoza/eslint-config-core/layout",
|
|
13
|
+
|
|
14
|
+
rules: {
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 🔧 Require or disallow Unicode byte order mark (BOM)
|
|
18
|
+
*
|
|
19
|
+
* @see http://eslint.org/docs/rules/unicode-bom
|
|
20
|
+
*/
|
|
21
|
+
"unicode-bom": "warn",
|
|
22
|
+
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* ESLint ready config for `@futagoza/eslint-config-core/rules/layout.js`
|
|
29
|
+
*/
|
|
30
|
+
export default [ config ]
|