@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 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.3.0) installed:
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 './dist/index.mjs'
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 { ConfigOptions, eslintConfig } from '@santi020k/eslint-config-santi020k';
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: [ConfigOptions.Ts] }),
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: [ConfigOptions.React] }),
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: [ConfigOptions.React, ConfigOptions.Ts] }),
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: [ConfigOptions.Next] }),
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: [ConfigOptions.Next, ConfigOptions.Ts] }),
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: [ConfigOptions.Expo] }),
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: [ConfigOptions.Expo, ConfigOptions.Ts] }),
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: [ConfigOptions.Astro] }),
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: [ConfigOptions.Astro, ConfigOptions.Ts] }),
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 { ConfigOptions, eslintConfig, OptionalOptions } from '@santi020k/eslint-config-santi020k';
112
+ import { ConfigOption, eslintConfig, OptionalOption } from '@santi020k/eslint-config-santi020k';
113
113
 
114
114
  export default [
115
115
  ...eslintConfig({
116
- config: [ConfigOptions.Next, ConfigOptions.Ts],
116
+ config: [ConfigOption.Next, ConfigOption.Ts],
117
117
  optionals: [
118
118
  // Spell checker
119
- OptionalOptions.Cspell,
119
+ OptionalOption.Cspell,
120
120
  // TailwindCss
121
- OptionalOptions.Tailwind,
121
+ OptionalOption.Tailwind,
122
122
  // Vitest and testing-library
123
- OptionalOptions.Vitest,
123
+ OptionalOption.Vitest,
124
124
  // I18next
125
- OptionalOptions.I18next
125
+ OptionalOption.I18next
126
126
  ]
127
127
  }),
128
128
  // Your custom config
package/dist/index.d.ts CHANGED
@@ -1,21 +1,28 @@
1
- import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
2
- declare enum ConfigOptions {
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 OptionalOptions {
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?: ConfigOptions[];
18
- optionals?: OptionalOptions[];
19
+ config?: ConfigOption[];
20
+ optionals?: OptionalOption[];
19
21
  }
20
- declare const eslintConfig: ({ config, optionals }?: EslintConfig) => FlatConfig.ConfigArray;
21
- export { ConfigOptions, eslintConfig, OptionalOptions };
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 };