@santi020k/eslint-config-santi020k 2.1.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/README.md +18 -18
- package/dist/index.d.ts +14 -7
- package/dist/index.js +530 -439
- package/package.json +50 -48
- package/dist/configs/astro/index.config.d.ts +0 -22
- package/dist/configs/astro/rules.d.ts +0 -18
- package/dist/configs/expo/index.config.d.ts +0 -9
- package/dist/configs/expo/rules.d.ts +0 -6
- package/dist/configs/index.d.ts +0 -6
- package/dist/configs/js/index.config.d.ts +0 -3
- package/dist/configs/js/rules.d.ts +0 -4
- package/dist/configs/next/index.config.d.ts +0 -9
- package/dist/configs/next/rules.d.ts +0 -6
- package/dist/configs/react/index.config.d.ts +0 -11
- package/dist/configs/react/rules.d.ts +0 -3
- package/dist/configs/ts/index.config.d.ts +0 -3
- package/dist/configs/ts/rules.d.ts +0 -25
- package/dist/index.mjs +0 -489
- package/dist/optionals/cspell.d.ts +0 -15
- package/dist/optionals/i18next.d.ts +0 -2
- package/dist/optionals/index.d.ts +0 -6
- package/dist/optionals/mdx.d.ts +0 -21
- package/dist/optionals/tailwind.d.ts +0 -2
- package/dist/optionals/vitest.d.ts +0 -23
- package/dist/package.json +0 -107
- package/dist/utils/flatCompat.d.ts +0 -6
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Welcome to @santi020k/eslint-config-santi020k, a comprehensive and opinionated E
|
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
-
First, ensure you have ESLint (9.
|
|
14
|
+
First, ensure you have ESLint (9.0.0 or latest) installed:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install eslint --save-dev
|
|
@@ -32,7 +32,7 @@ Create an eslint.config.js file (or use your existing one) and extend @santi020k
|
|
|
32
32
|
For a basic JavaScript project:
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import { eslintConfig } from '
|
|
35
|
+
import { eslintConfig } from '@santi020k/eslint-config-santi020k'
|
|
36
36
|
|
|
37
37
|
export default [
|
|
38
38
|
...eslintConfig(),
|
|
@@ -45,61 +45,61 @@ For a basic JavaScript project:
|
|
|
45
45
|
For projects with specific configurations (TypeScript, React, Next.js, etc.), use the appropriate options:
|
|
46
46
|
|
|
47
47
|
```js
|
|
48
|
-
import {
|
|
48
|
+
import { ConfigOption, eslintConfig } from '@santi020k/eslint-config-santi020k';
|
|
49
49
|
|
|
50
50
|
// Examples of different configurations
|
|
51
51
|
|
|
52
52
|
// TypeScript project
|
|
53
53
|
export default [
|
|
54
|
-
...eslintConfig({ config: [
|
|
54
|
+
...eslintConfig({ config: [ConfigOption.Ts] }),
|
|
55
55
|
// Your custom config
|
|
56
56
|
];
|
|
57
57
|
|
|
58
58
|
// React project
|
|
59
59
|
export default [
|
|
60
|
-
...eslintConfig({ config: [
|
|
60
|
+
...eslintConfig({ config: [ConfigOption.React] }),
|
|
61
61
|
// Your custom config
|
|
62
62
|
];
|
|
63
63
|
|
|
64
64
|
// TypeScript and React project
|
|
65
65
|
export default [
|
|
66
|
-
...eslintConfig({ config: [
|
|
66
|
+
...eslintConfig({ config: [ConfigOption.React, ConfigOption.Ts] }),
|
|
67
67
|
// Your custom config
|
|
68
68
|
];
|
|
69
69
|
|
|
70
70
|
// Next.js project
|
|
71
71
|
export default [
|
|
72
|
-
...eslintConfig({ config: [
|
|
72
|
+
...eslintConfig({ config: [ConfigOption.Next] }),
|
|
73
73
|
// Your custom config
|
|
74
74
|
];
|
|
75
75
|
|
|
76
76
|
// TypeScript and Next.js project
|
|
77
77
|
export default [
|
|
78
|
-
...eslintConfig({ config: [
|
|
78
|
+
...eslintConfig({ config: [ConfigOption.Next, ConfigOption.Ts] }),
|
|
79
79
|
// Your custom config
|
|
80
80
|
];
|
|
81
81
|
|
|
82
82
|
// Expo project (Beta)
|
|
83
83
|
export default [
|
|
84
|
-
...eslintConfig({ config: [
|
|
84
|
+
...eslintConfig({ config: [ConfigOption.Expo] }),
|
|
85
85
|
// Your custom config
|
|
86
86
|
];
|
|
87
87
|
|
|
88
88
|
// TypeScript and Expo project (Beta)
|
|
89
89
|
export default [
|
|
90
|
-
...eslintConfig({ config: [
|
|
90
|
+
...eslintConfig({ config: [ConfigOption.Expo, ConfigOption.Ts] }),
|
|
91
91
|
// Your custom config
|
|
92
92
|
];
|
|
93
93
|
|
|
94
94
|
// Astro project (beta, supports Astro with React)
|
|
95
95
|
export default [
|
|
96
|
-
...eslintConfig({ config: [
|
|
96
|
+
...eslintConfig({ config: [ConfigOption.Astro] }),
|
|
97
97
|
// Your custom config
|
|
98
98
|
];
|
|
99
99
|
|
|
100
100
|
// TypeScript and Astro project (beta, supports Astro with React)
|
|
101
101
|
export default [
|
|
102
|
-
...eslintConfig({ config: [
|
|
102
|
+
...eslintConfig({ config: [ConfigOption.Astro, ConfigOption.Ts] }),
|
|
103
103
|
// Your custom config
|
|
104
104
|
];
|
|
105
105
|
```
|
|
@@ -109,20 +109,20 @@ For projects with specific configurations (TypeScript, React, Next.js, etc.), us
|
|
|
109
109
|
Additionally, there are some optional parameters that add support to other technologies that could be needed in a front-end project. The idea is to add support for more options in the future. Here is an example of how to use these optionals:
|
|
110
110
|
|
|
111
111
|
```js
|
|
112
|
-
import {
|
|
112
|
+
import { ConfigOption, eslintConfig, OptionalOption } from '@santi020k/eslint-config-santi020k';
|
|
113
113
|
|
|
114
114
|
export default [
|
|
115
115
|
...eslintConfig({
|
|
116
|
-
config: [
|
|
116
|
+
config: [ConfigOption.Next, ConfigOption.Ts],
|
|
117
117
|
optionals: [
|
|
118
118
|
// Spell checker
|
|
119
|
-
|
|
119
|
+
OptionalOption.Cspell,
|
|
120
120
|
// TailwindCss
|
|
121
|
-
|
|
121
|
+
OptionalOption.Tailwind,
|
|
122
122
|
// Vitest and testing-library
|
|
123
|
-
|
|
123
|
+
OptionalOption.Vitest,
|
|
124
124
|
// I18next
|
|
125
|
-
|
|
125
|
+
OptionalOption.I18next
|
|
126
126
|
]
|
|
127
127
|
}),
|
|
128
128
|
// Your custom config
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
|
|
3
|
+
declare enum ConfigOption {
|
|
3
4
|
Ts = "ts",
|
|
4
5
|
React = "react",
|
|
5
6
|
Next = "next",
|
|
6
7
|
Expo = "expo",
|
|
7
8
|
Astro = "astro"
|
|
8
9
|
}
|
|
9
|
-
declare enum
|
|
10
|
+
declare enum OptionalOption {
|
|
10
11
|
Cspell = "cspell",
|
|
11
12
|
Tailwind = "tailwind",
|
|
12
13
|
Vitest = "vitest",
|
|
13
14
|
I18next = "i18next",
|
|
14
15
|
Mdx = "mdx"
|
|
15
16
|
}
|
|
17
|
+
declare const ReactConfigs: ConfigOption[];
|
|
16
18
|
interface EslintConfig {
|
|
17
|
-
config?:
|
|
18
|
-
optionals?:
|
|
19
|
+
config?: ConfigOption[];
|
|
20
|
+
optionals?: OptionalOption[];
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Main function to generate ESLint configuration array.
|
|
24
|
+
* !important: The array order is important, the lower the more important
|
|
25
|
+
*/
|
|
26
|
+
declare const eslintConfig: ({ config, optionals }?: EslintConfig) => TSESLint.FlatConfig.ConfigArray;
|
|
27
|
+
|
|
28
|
+
export { ConfigOption, OptionalOption, ReactConfigs, eslintConfig };
|