@castiron/eslint-config 2.0.0-beta.0 → 2.1.0-alpha.6
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/CHANGELOG.md +11 -0
- package/README.md +17 -6
- package/configs/base.mjs +3 -0
- package/index.mjs +3 -5
- package/package.json +37 -23
- package/configs/react.mjs +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
**All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org).**
|
|
4
4
|
|
|
5
|
+
## [2.0.0](https://github.com/castiron/eslint-config-cic/compare/eslint-config-v2.0.0-beta.0...eslint-config-v2.0.0) (2026-09-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Upgrade to eslint v10 ([959432a](https://github.com/castiron/eslint-config-cic/commit/959432a8c8752c80894d3c8106d6b0d6a8b774fe))
|
|
11
|
+
|
|
5
12
|
## 2.0.0-beta.0
|
|
6
13
|
|
|
7
14
|
- Adds npmMinimalAgeGate: 3d to yarn config
|
|
@@ -12,6 +19,10 @@
|
|
|
12
19
|
- Upgrades typescript to v6
|
|
13
20
|
- Added @eslint/js to peer dependencies
|
|
14
21
|
|
|
22
|
+
## 1.1.0-alpha.0
|
|
23
|
+
|
|
24
|
+
- Upgrade minor package versions
|
|
25
|
+
|
|
15
26
|
## 1.0.0
|
|
16
27
|
|
|
17
28
|
- Publish v1
|
package/README.md
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
# eslint-config
|
|
1
|
+
# @castiron/eslint-config
|
|
2
2
|
|
|
3
|
-
An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for CIC projects
|
|
3
|
+
An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for CIC projects.
|
|
4
|
+
|
|
5
|
+
For React projects, use [`@castiron/eslint-config-react`](../eslint-config-react) instead.
|
|
4
6
|
|
|
5
7
|
## 💿 Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
yarn add @castiron/eslint-config
|
|
10
|
+
yarn add -D @castiron/eslint-config eslint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The TypeScript config (and the default export, which includes it) needs TypeScript and its plugins installed alongside:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add -D typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin
|
|
9
17
|
```
|
|
10
18
|
|
|
11
19
|
## 📖 Usage
|
|
@@ -21,12 +29,13 @@ import cicConfig from "@castiron/eslint-config";
|
|
|
21
29
|
export default [...cicConfig];
|
|
22
30
|
```
|
|
23
31
|
|
|
24
|
-
If you'd like to use only some of the rules, each config
|
|
32
|
+
If you'd like to use only some of the rules, import each config from its own entry point (`/base`, `/js`, `/ts`) so plugins for unused configs are never loaded:
|
|
25
33
|
|
|
26
34
|
```js
|
|
27
35
|
// Example: Vanilla js project with babel parser.
|
|
28
36
|
// eslint.config.js
|
|
29
|
-
import
|
|
37
|
+
import baseConfig from "@castiron/eslint-config/base";
|
|
38
|
+
import jsConfig from "@castiron/eslint-config/js";
|
|
30
39
|
|
|
31
40
|
export default [
|
|
32
41
|
{
|
|
@@ -50,7 +59,9 @@ export default [
|
|
|
50
59
|
```js
|
|
51
60
|
// Example: Astro project without react.
|
|
52
61
|
// eslint.config.js
|
|
53
|
-
import
|
|
62
|
+
import baseConfig from "@castiron/eslint-config/base";
|
|
63
|
+
import jsConfig from "@castiron/eslint-config/js";
|
|
64
|
+
import tsConfig from "@castiron/eslint-config/ts";
|
|
54
65
|
import eslintPluginAstro from "eslint-plugin-astro";
|
|
55
66
|
|
|
56
67
|
export default [
|
package/configs/base.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import eslintPluginRegexp from "eslint-plugin-regexp";
|
|
1
2
|
import unusedImports from "eslint-plugin-unused-imports";
|
|
2
3
|
import globals from "globals";
|
|
3
4
|
|
|
@@ -9,6 +10,7 @@ const baseConfig = {
|
|
|
9
10
|
}
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
13
|
+
...eslintPluginRegexp.configs["flat/recommended"].rules,
|
|
12
14
|
"array-callback-return": 0,
|
|
13
15
|
"arrow-body-style": 0,
|
|
14
16
|
"global-require": 0,
|
|
@@ -54,6 +56,7 @@ const baseConfig = {
|
|
|
54
56
|
},
|
|
55
57
|
plugins: {
|
|
56
58
|
"unused-imports": unusedImports,
|
|
59
|
+
regexp: eslintPluginRegexp,
|
|
57
60
|
}
|
|
58
61
|
};
|
|
59
62
|
|
package/index.mjs
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import baseConfig from "./configs/base.mjs";
|
|
2
2
|
import jsConfig from "./configs/js.mjs";
|
|
3
3
|
import tsConfig from "./configs/ts.mjs";
|
|
4
|
-
import reactConfig from "./configs/react.mjs";
|
|
5
4
|
|
|
6
|
-
// Export one big config (
|
|
5
|
+
// Export one big config (TS projects)
|
|
7
6
|
export default [
|
|
8
7
|
baseConfig,
|
|
9
8
|
jsConfig,
|
|
10
|
-
tsConfig
|
|
11
|
-
reactConfig
|
|
9
|
+
tsConfig
|
|
12
10
|
];
|
|
13
11
|
|
|
14
12
|
// Export configs separately for finer control over linting rules
|
|
15
|
-
export { baseConfig, jsConfig, tsConfig
|
|
13
|
+
export { baseConfig, jsConfig, tsConfig };
|
package/package.json
CHANGED
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@castiron/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0-alpha.6",
|
|
4
4
|
"description": "General eslint configuration for Cast Iron Coding projects",
|
|
5
5
|
"main": "index.mjs",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.mjs",
|
|
8
|
+
"./base": "./configs/base.mjs",
|
|
9
|
+
"./js": "./configs/js.mjs",
|
|
10
|
+
"./ts": "./configs/ts.mjs",
|
|
11
|
+
"./package.json": "./package.json"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"index.mjs",
|
|
15
|
+
"configs",
|
|
16
|
+
"CHANGELOG.md"
|
|
17
|
+
],
|
|
6
18
|
"repository": {
|
|
7
19
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/castiron/eslint-config-cic.git"
|
|
20
|
+
"url": "git+https://github.com/castiron/eslint-config-cic.git",
|
|
21
|
+
"directory": "packages/eslint-config"
|
|
9
22
|
},
|
|
10
23
|
"author": "Cast Iron Coding",
|
|
11
24
|
"license": "MIT",
|
|
12
25
|
"bugs": {
|
|
13
26
|
"url": "https://github.com/castiron/eslint-config-cic/issues"
|
|
14
27
|
},
|
|
15
|
-
"homepage": "https://github.com/castiron/eslint-config-cic#readme",
|
|
28
|
+
"homepage": "https://github.com/castiron/eslint-config-cic/tree/main/packages/eslint-config#readme",
|
|
16
29
|
"engines": {
|
|
17
30
|
"node": ">=24.x"
|
|
18
31
|
},
|
|
19
32
|
"scripts": {
|
|
20
|
-
"npm:publish": "yarn npm publish --access public"
|
|
21
|
-
"lint": "eslint . --config index.mjs",
|
|
22
|
-
"fix": "eslint . --fix"
|
|
33
|
+
"npm:publish": "yarn npm publish --access public"
|
|
23
34
|
},
|
|
24
|
-
"
|
|
35
|
+
"dependencies": {
|
|
25
36
|
"@eslint/js": "^10.0.1",
|
|
26
|
-
"
|
|
27
|
-
"@typescript-eslint/parser": "^8.59.2",
|
|
28
|
-
"eslint": "^10.3.0",
|
|
29
|
-
"eslint-plugin-import": "^2.32.0",
|
|
30
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
31
|
-
"eslint-plugin-react": "^7.37.5",
|
|
32
|
-
"eslint-plugin-react-hooks": "^7.1.1",
|
|
37
|
+
"eslint-plugin-regexp": "^3.3.1",
|
|
33
38
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
34
|
-
"globals": "^17.
|
|
39
|
+
"globals": "^17.12.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.70.1",
|
|
43
|
+
"@typescript-eslint/parser": "^8.70.1",
|
|
44
|
+
"eslint": "^10.11.0",
|
|
35
45
|
"typescript": "^6.0.3"
|
|
36
46
|
},
|
|
37
47
|
"peerDependencies": {
|
|
38
48
|
"@typescript-eslint/eslint-plugin": ">= 8",
|
|
39
49
|
"@typescript-eslint/parser": ">= 8",
|
|
40
|
-
"@eslint/js": ">= 10",
|
|
41
50
|
"eslint": ">= 10",
|
|
42
|
-
"eslint-plugin-import": ">= 2",
|
|
43
|
-
"eslint-plugin-jsx-a11y": ">= 6",
|
|
44
|
-
"eslint-plugin-react": ">= 7",
|
|
45
|
-
"eslint-plugin-react-hooks": ">= 7",
|
|
46
|
-
"eslint-plugin-unused-imports": ">= 4",
|
|
47
51
|
"typescript": ">= 6"
|
|
48
52
|
},
|
|
49
|
-
"
|
|
50
|
-
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@typescript-eslint/eslint-plugin": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"@typescript-eslint/parser": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"typescript": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/configs/react.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import reactHooks from "eslint-plugin-react-hooks";
|
|
2
|
-
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
3
|
-
|
|
4
|
-
const reactConfig = {
|
|
5
|
-
files: ["**/*.{jsx,tsx}"],
|
|
6
|
-
rules: {
|
|
7
|
-
...reactHooks.configs.recommended.rules,
|
|
8
|
-
...jsxA11y.configs.recommended.rules,
|
|
9
|
-
// React rules
|
|
10
|
-
"react-hooks/rules-of-hooks": ["warn"],
|
|
11
|
-
"react/react-in-jsx-scope": ["off"],
|
|
12
|
-
"react/display-name": ["off"],
|
|
13
|
-
},
|
|
14
|
-
plugins: {
|
|
15
|
-
"jsx-a11y": jsxA11y,
|
|
16
|
-
"react-hooks": reactHooks,
|
|
17
|
-
},
|
|
18
|
-
settings: {
|
|
19
|
-
react: {
|
|
20
|
-
version: "detect",
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default reactConfig;
|