@commencis/eslint-config 2.4.0 → 3.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/CHANGELOG.md +12 -0
- package/README.md +46 -48
- package/dist/{flatConfig-Cm6wkwA_.d.ts → config.types-M1gOzpFJ.d.mts} +12 -6
- package/dist/configFactory-D_qKOxEp.mjs +574 -0
- package/dist/configs/javascript.d.mts +8 -0
- package/dist/configs/javascript.mjs +9 -0
- package/dist/configs/native.d.mts +8 -0
- package/dist/configs/native.mjs +12 -0
- package/dist/configs/next.d.mts +8 -0
- package/dist/configs/next.mjs +13 -0
- package/dist/configs/react.d.mts +8 -0
- package/dist/configs/react.mjs +12 -0
- package/dist/configs/typescript.d.mts +8 -0
- package/dist/configs/typescript.mjs +9 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.mjs +7 -0
- package/package.json +24 -36
- package/dist/configs/base.d.ts +0 -8
- package/dist/configs/base.js +0 -245
- package/dist/configs/next.d.ts +0 -6
- package/dist/configs/next.js +0 -301
- package/dist/configs/prettier.d.ts +0 -6
- package/dist/configs/prettier.js +0 -9
- package/dist/configs/react-native.d.ts +0 -6
- package/dist/configs/react-native.js +0 -300
- package/dist/configs/react.d.ts +0 -6
- package/dist/configs/react.js +0 -300
- package/dist/configs/typescript.d.ts +0 -6
- package/dist/configs/typescript.js +0 -135
- package/dist/configs/vue.d.ts +0 -6
- package/dist/configs/vue.js +0 -313
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -358
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @commencis/eslint-config
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [BreakingChange]: Introducing v3 - With cleaner dependencies and structure. Check readme files for implementations. ([#414](https://github.com/Commencis/js-toolkit/pull/414))
|
|
8
|
+
|
|
9
|
+
## 2.5.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- chore: update minor dependencies, node to v24.12 and pnpm to v10.25 ([#408](https://github.com/Commencis/js-toolkit/pull/408))
|
|
14
|
+
|
|
3
15
|
## 2.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -29,74 +29,72 @@ pnpm add --save-dev eslint @commencis/eslint-config
|
|
|
29
29
|
> [!IMPORTANT]
|
|
30
30
|
> All the configs provided by this package is for the new [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new) that supported with `ESLint >= v9`
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Access the `defineConfig` function directly from this package, or import it from `eslint/config` as needed.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
- Typescript: `commencisTypescriptConfig`
|
|
36
|
-
- React: `commencisReactConfig`
|
|
37
|
-
- NextJs: `commencisNextConfig`
|
|
38
|
-
- Vue: `commencisVueConfig`
|
|
39
|
-
- Prettier: `commencisPrettierConfig`
|
|
34
|
+
## Configs & Helper Exports
|
|
40
35
|
|
|
41
|
-
|
|
36
|
+
This package includes pre-configured configs for:
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
- **Javascript**
|
|
39
|
+
- **Typescript**
|
|
40
|
+
- **React**
|
|
41
|
+
- **NextJs**
|
|
42
|
+
- **ReactNative**
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
// eslint.config.js
|
|
47
|
-
import { commencisReactConfig, defineConfig } from '@commencis/eslint-config';
|
|
48
|
-
|
|
49
|
-
export default defineConfig(...commencisReactConfig, {
|
|
50
|
-
/* ... */
|
|
51
|
-
});
|
|
52
|
-
```
|
|
44
|
+
To use the default rules without additional customization, export the base configuration as shown below:
|
|
53
45
|
|
|
54
|
-
###
|
|
46
|
+
### Basic Usage without Overrides
|
|
55
47
|
|
|
56
48
|
```javascript
|
|
57
|
-
// eslint.config.
|
|
58
|
-
|
|
59
|
-
commencisReactNativeConfig,
|
|
60
|
-
defineConfig,
|
|
61
|
-
} from '@commencis/eslint-config';
|
|
62
|
-
|
|
63
|
-
export default defineConfig(...commencisReactNativeConfig, {
|
|
64
|
-
/* ... */
|
|
65
|
-
});
|
|
49
|
+
// eslint.config.mjs
|
|
50
|
+
export { default } from '@commencis/eslint-config/react';
|
|
66
51
|
```
|
|
67
52
|
|
|
68
|
-
|
|
53
|
+
Default export is available on:
|
|
69
54
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
- `@commencis/eslint-config/javascript`;
|
|
56
|
+
- `@commencis/eslint-config/typescript`;
|
|
57
|
+
- `@commencis/eslint-config/react`;
|
|
58
|
+
- `@commencis/eslint-config/next`;
|
|
59
|
+
- `@commencis/eslint-config/native`;
|
|
73
60
|
|
|
74
|
-
|
|
75
|
-
ignores: ['.next/', 'next.config.js', 'next-env.d.ts'],
|
|
76
|
-
});
|
|
77
|
-
```
|
|
61
|
+
### Flexible Usage with Overrides
|
|
78
62
|
|
|
79
|
-
|
|
63
|
+
Alternatively, to use overrides:
|
|
80
64
|
|
|
81
|
-
|
|
82
|
-
// eslint.config.js
|
|
83
|
-
import { commencisVueConfig, defineConfig } from '@commencis/eslint-config';
|
|
65
|
+
Find desired named exports:
|
|
84
66
|
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
- `javascriptConfig`
|
|
68
|
+
- `typescriptConfig`
|
|
69
|
+
- `reactConfig`
|
|
70
|
+
- `nextConfig`
|
|
71
|
+
- `reactNativeConfig`
|
|
87
72
|
|
|
88
|
-
|
|
73
|
+
```javascript
|
|
74
|
+
// eslint.config.mjs
|
|
75
|
+
export { nextConfig, defineConfig } from '@commencis/eslint-config';
|
|
89
76
|
|
|
90
|
-
|
|
77
|
+
export default defineConfig(next, {
|
|
78
|
+
// overrides
|
|
79
|
+
});
|
|
80
|
+
```
|
|
91
81
|
|
|
92
|
-
|
|
82
|
+
### New `configFactory` Usage with Overrides:
|
|
93
83
|
|
|
94
84
|
```javascript
|
|
95
|
-
// eslint.config.
|
|
96
|
-
|
|
97
|
-
|
|
85
|
+
// eslint.config.mjs
|
|
86
|
+
export { configFactory, defineConfig } from '@commencis/eslint-config';
|
|
87
|
+
|
|
88
|
+
const config = configFactory({
|
|
89
|
+
react: true,
|
|
90
|
+
next: true,
|
|
91
|
+
jsxA11y: true,
|
|
92
|
+
reactCompiler: true,
|
|
93
|
+
});
|
|
98
94
|
|
|
99
|
-
export default
|
|
95
|
+
export default defineConfig(config, {
|
|
96
|
+
// overrides
|
|
97
|
+
});
|
|
100
98
|
```
|
|
101
99
|
|
|
102
100
|
## References
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { Linter } from
|
|
1
|
+
import { Linter } from "eslint";
|
|
2
|
+
|
|
3
|
+
//#region src/types/config.types.d.ts
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* Relax plugins type limitation,
|
|
@@ -10,9 +12,13 @@ import { Linter } from 'eslint';
|
|
|
10
12
|
* @see Using plugins in your configuration]
|
|
11
13
|
* (https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
12
14
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Plugin relaxation reverted temporarily,
|
|
17
|
+
* which causes type errors in the config files.
|
|
18
|
+
*/
|
|
19
|
+
type Ruleset = Linter.Config & {
|
|
20
|
+
name: string;
|
|
15
21
|
};
|
|
16
|
-
type
|
|
17
|
-
|
|
18
|
-
export
|
|
22
|
+
type FlatConfig = Ruleset[];
|
|
23
|
+
//#endregion
|
|
24
|
+
export { FlatConfig as t };
|