@santi020k/eslint-config-santi020k 2.1.0 → 3.1.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 +22 -18
- package/dist/index.d.ts +31 -8
- package/dist/index.js +567 -439
- package/package.json +52 -49
- 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,24 @@ 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
|
+
// Mdx
|
|
127
|
+
OptionalOption.Mdx
|
|
128
|
+
// Markdown
|
|
129
|
+
OptionalOption.Markdown
|
|
126
130
|
]
|
|
127
131
|
}),
|
|
128
132
|
// Your custom config
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enum for configuration options in ESLint
|
|
5
|
+
*/
|
|
6
|
+
declare enum ConfigOption {
|
|
3
7
|
Ts = "ts",
|
|
4
8
|
React = "react",
|
|
5
9
|
Next = "next",
|
|
6
10
|
Expo = "expo",
|
|
7
11
|
Astro = "astro"
|
|
8
12
|
}
|
|
9
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Enum for optional features that can be included in ESLint
|
|
15
|
+
*/
|
|
16
|
+
declare enum OptionalOption {
|
|
10
17
|
Cspell = "cspell",
|
|
11
18
|
Tailwind = "tailwind",
|
|
12
19
|
Vitest = "vitest",
|
|
13
20
|
I18next = "i18next",
|
|
14
|
-
Mdx = "mdx"
|
|
21
|
+
Mdx = "mdx",
|
|
22
|
+
Markdown = "markdown"
|
|
15
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Array of configurations that require React
|
|
26
|
+
*/
|
|
27
|
+
declare const ReactConfigs: ConfigOption[];
|
|
28
|
+
/**
|
|
29
|
+
* ESLint configuration interface
|
|
30
|
+
*/
|
|
16
31
|
interface EslintConfig {
|
|
17
|
-
config?:
|
|
18
|
-
optionals?:
|
|
32
|
+
config?: ConfigOption[];
|
|
33
|
+
optionals?: OptionalOption[];
|
|
19
34
|
}
|
|
20
|
-
|
|
21
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Generates the ESLint configuration array, applying configurations
|
|
37
|
+
* and optional settings based on the input configuration.
|
|
38
|
+
*
|
|
39
|
+
* @param {EslintConfig} options - Configuration and optional settings
|
|
40
|
+
* @returns {TSESLint.FlatConfig.ConfigArray} The final ESLint configuration array
|
|
41
|
+
*/
|
|
42
|
+
declare const eslintConfig: ({ config, optionals }?: EslintConfig) => TSESLint.FlatConfig.ConfigArray;
|
|
43
|
+
|
|
44
|
+
export { ConfigOption, OptionalOption, ReactConfigs, eslintConfig };
|