@futagoza/eslint-config-core 16.1.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 CHANGED
@@ -1,43 +1,68 @@
1
- [![dependencies](https://img.shields.io/david/futagoza/eslint-config-futagozaryuu.svg?path=packages/@futagoza/eslint-config-core)](https://david-dm.org/futagoza/eslint-config-futagozaryuu?path=packages/@futagoza/eslint-config-core)
2
- [![History](https://img.shields.io/badge/history-CHANGELOG.md-orange.svg)](https://github.com/futagoza/eslint-config-futagozaryuu/blob/master/CHANGELOG.md)
3
- [![License](https://img.shields.io/badge/license-mit-blue.svg)](https://opensource.org/licenses/MIT)
4
-
5
- > This package contains configuration files for ESLint v7.15+<br>
6
-
7
- These are configuration files for ESLint that are mostly extended upon by my other ESLint configurations.
8
-
9
- The rules set in these files are the core set of built in rules separated by 4 categories: _possible-errors_, _best-practices_, _stylistic-issues_ and _variables_.
10
-
11
- ## installation
12
-
13
- ```console
14
- $ npm i --save-dev @futagoza/eslint-config-core
15
- ```
16
-
17
- ## usage
18
-
19
- Put the following into your configuration (`.eslintrc.*` file or the _"eslintConfig"_ field in `package.json`):
20
-
21
- ```json
22
- {
23
- "extends": "@futagoza/core"
24
- }
25
- ```
26
-
27
- ## configurations
28
-
29
- A list of usable configurations as well the configurations they use:
30
-
31
- - __`@futagoza/core`__ (_default_, extends: _possible-errors_, _best-practices_, _stylistic-issues_ and _variables_)
32
- - __`@futagoza/core/possible-errors`__
33
- - __`@futagoza/core/best-practices`__
34
- - __`@futagoza/core/stylistic-issues`__
35
- - __`@futagoza/core/variables`__
36
- - __`@futagoza/core/ecmascript-6`__
37
-
38
- You can also use `import { config } from "@futagoza/eslint-config-core/internal"` to get the default options for these rules.
39
-
40
- ## license
41
-
42
- Copyright © 2017+ Futago-za Ryuu<br>
43
- Released under the MIT License, [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)
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
- "use strict";
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
- module.exports = {
7
+ /**
8
+ * ESLint's built-in rules
9
+ */
10
+ export const EslintRules = {
4
11
 
5
- "extends": [
12
+ ...LayoutConfig.rules,
13
+ ...ProblemConfig.rules,
14
+ ...SuggestionConfig.rules,
6
15
 
7
- "./possible-errors.js",
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
- "reportUnusedDisableDirectives": true,
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": "16.1.0",
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": ">=12.0.0"
20
+ "node": ">=20.0.0"
16
21
  }
17
22
  }
@@ -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 ]