@commencis/eslint-config 1.0.1 → 1.2.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 ADDED
@@ -0,0 +1,19 @@
1
+ # @commencis/eslint-config
2
+
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#76](https://github.com/Commencis/js-toolkit/pull/76) [`ff2a968`](https://github.com/Commencis/js-toolkit/commit/ff2a9683e84252c4b0ee47466b8694f366b0b95c) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - update eslint vue plugin that has new enhancements and fixes
8
+
9
+ - [#90](https://github.com/Commencis/js-toolkit/pull/90) [`e114f46`](https://github.com/Commencis/js-toolkit/commit/e114f46814ea3f599d1d820b8d4b191739ac9574) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - update eslint dependencies
10
+
11
+ - [#93](https://github.com/Commencis/js-toolkit/pull/93) [`b45eb96`](https://github.com/Commencis/js-toolkit/commit/b45eb969560be34dcce0df9038d7330da21cd405) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - use eslint-plugin-vue types
12
+
13
+ - [#95](https://github.com/Commencis/js-toolkit/pull/95) [`da901a0`](https://github.com/Commencis/js-toolkit/commit/da901a0ab7f084d24a75a7338bc7c096f33df982) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - update eslint-plugin-next version
14
+
15
+ - [#78](https://github.com/Commencis/js-toolkit/pull/78) [`3988b57`](https://github.com/Commencis/js-toolkit/commit/3988b57e0126fd70f6d45abc69fff30315b140b1) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - update react-hooks plugin version
16
+
17
+ ### Patch Changes
18
+
19
+ - [#86](https://github.com/Commencis/js-toolkit/pull/86) [`99b673b`](https://github.com/Commencis/js-toolkit/commit/99b673b155a2bff35fbacd6e13b11db18ea7cce8) Thanks [@ymehmetcan](https://github.com/ymehmetcan)! - update typescript-eslint dependencies
package/README.md CHANGED
@@ -51,6 +51,20 @@ export default defineConfig(...commencisReactConfig, {
51
51
  });
52
52
  ```
53
53
 
54
+ ### Example Usage for React-Native/Typescript Project:
55
+
56
+ ```javascript
57
+ // eslint.config.js
58
+ import {
59
+ commencisReactNativeConfig,
60
+ defineConfig,
61
+ } from '@commencis/eslint-config';
62
+
63
+ export default defineConfig(...commencisReactNativeConfig, {
64
+ /* ... */
65
+ });
66
+ ```
67
+
54
68
  ### Example Usage for NextJs/Typescript Project:
55
69
 
56
70
  ```javascript
@@ -1,5 +1,5 @@
1
1
  import * as eslint from 'eslint';
2
- import { F as FlatConfig } from '../flatConfig-CFiBdxNB.js';
2
+ import { F as FlatConfig } from '../flatConfig-Cm6wkwA_.js';
3
3
 
4
4
  declare const _default: (FlatConfig | {
5
5
  readonly rules: Readonly<eslint.Linter.RulesRecord>;
@@ -57,7 +57,9 @@ var reactRules = {
57
57
  // No longer necessary
58
58
  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
59
59
  "react/jsx-uses-react": "off",
60
- "react/react-in-jsx-scope": "off"
60
+ "react/react-in-jsx-scope": "off",
61
+ // We are not planning to utilize rules below
62
+ "react/jsx-props-no-spreading": "off"
61
63
  };
62
64
 
63
65
  // src/plugins/importSortPlugin.ts
@@ -71,13 +73,27 @@ var importSortPluginConfig = {
71
73
  }
72
74
  };
73
75
 
74
- // src/plugins/nextPlugin.ts
75
- import nextPlugin from "@next/eslint-plugin-next";
76
+ // src/plugins/jsxA11yPlugin.ts
77
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
76
78
 
77
79
  // src/constants/index.ts
78
80
  var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
79
81
 
82
+ // src/plugins/jsxA11yPlugin.ts
83
+ var jsxA11yPluginConfig = {
84
+ name: "commencis/plugin:jsx-a11y",
85
+ files: JSX_TSX_FILE_PATTERNS,
86
+ plugins: {
87
+ "jsx-a11y": jsxA11yPlugin
88
+ },
89
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
90
+ rules: {
91
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
92
+ }
93
+ };
94
+
80
95
  // src/plugins/nextPlugin.ts
96
+ import nextPlugin from "@next/eslint-plugin-next";
81
97
  var nextPluginConfig = {
82
98
  name: "commencis/plugin:next",
83
99
  files: JSX_TSX_FILE_PATTERNS,
@@ -108,12 +124,13 @@ import reactPlugin from "eslint-plugin-react";
108
124
  var reactPluginConfig = {
109
125
  name: "commencis/plugin:react",
110
126
  files: JSX_TSX_FILE_PATTERNS,
111
- languageOptions: { ...reactPlugin.configs.recommended.languageOptions },
127
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
112
128
  plugins: {
113
129
  react: reactPlugin
114
130
  },
115
131
  rules: {
116
- ...reactPlugin.configs.recommended.rules,
132
+ ...reactPlugin.configs.flat.recommended.rules,
133
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
117
134
  ...reactRules
118
135
  },
119
136
  settings: {
@@ -1,4 +1,4 @@
1
- import { a as FlatConfigArray } from '../flatConfig-CFiBdxNB.js';
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
2
  import 'eslint';
3
3
 
4
4
  declare const _default: FlatConfigArray;
@@ -57,13 +57,17 @@ var reactRules = {
57
57
  // No longer necessary
58
58
  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
59
59
  "react/jsx-uses-react": "off",
60
- "react/react-in-jsx-scope": "off"
60
+ "react/react-in-jsx-scope": "off",
61
+ // We are not planning to utilize rules below
62
+ "react/jsx-props-no-spreading": "off"
61
63
  };
62
64
 
63
65
  // src/rules/typescriptRules.ts
64
66
  var typescriptRules = {
65
67
  "@typescript-eslint/consistent-type-definitions": "off",
66
- "@typescript-eslint/no-empty-function": "off"
68
+ "@typescript-eslint/no-empty-function": "off",
69
+ "@typescript-eslint/array-type": "off",
70
+ "@typescript-eslint/explicit-function-return-type": "error"
67
71
  };
68
72
 
69
73
  // src/plugins/importSortPlugin.ts
@@ -77,13 +81,27 @@ var importSortPluginConfig = {
77
81
  }
78
82
  };
79
83
 
80
- // src/plugins/nextPlugin.ts
81
- import nextPlugin from "@next/eslint-plugin-next";
84
+ // src/plugins/jsxA11yPlugin.ts
85
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
82
86
 
83
87
  // src/constants/index.ts
84
88
  var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
85
89
 
90
+ // src/plugins/jsxA11yPlugin.ts
91
+ var jsxA11yPluginConfig = {
92
+ name: "commencis/plugin:jsx-a11y",
93
+ files: JSX_TSX_FILE_PATTERNS,
94
+ plugins: {
95
+ "jsx-a11y": jsxA11yPlugin
96
+ },
97
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
98
+ rules: {
99
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
100
+ }
101
+ };
102
+
86
103
  // src/plugins/nextPlugin.ts
104
+ import nextPlugin from "@next/eslint-plugin-next";
87
105
  var nextPluginConfig = {
88
106
  name: "commencis/plugin:next",
89
107
  files: JSX_TSX_FILE_PATTERNS,
@@ -114,12 +132,13 @@ import reactPlugin from "eslint-plugin-react";
114
132
  var reactPluginConfig = {
115
133
  name: "commencis/plugin:react",
116
134
  files: JSX_TSX_FILE_PATTERNS,
117
- languageOptions: { ...reactPlugin.configs.recommended.languageOptions },
135
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
118
136
  plugins: {
119
137
  react: reactPlugin
120
138
  },
121
139
  rules: {
122
- ...reactPlugin.configs.recommended.rules,
140
+ ...reactPlugin.configs.flat.recommended.rules,
141
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
123
142
  ...reactRules
124
143
  },
125
144
  settings: {
@@ -185,6 +204,7 @@ var next_default = [
185
204
  ...typescript_default,
186
205
  reactPluginConfig,
187
206
  reactHooksPluginConfig,
207
+ jsxA11yPluginConfig,
188
208
  nextPluginConfig,
189
209
  ...prettier_default,
190
210
  { name: "commencis/next" }
@@ -1,4 +1,4 @@
1
- import { a as FlatConfigArray } from '../flatConfig-CFiBdxNB.js';
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
2
  import 'eslint';
3
3
 
4
4
  declare const _default: FlatConfigArray;
@@ -0,0 +1,6 @@
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
+ import 'eslint';
3
+
4
+ declare const _default: FlatConfigArray;
5
+
6
+ export { _default as default };
@@ -0,0 +1,213 @@
1
+ // src/configs/base.ts
2
+ import globals from "globals";
3
+ import eslint from "@eslint/js";
4
+
5
+ // src/plugins/importSortPlugin.ts
6
+ import simpleImportSortPlugin from "eslint-plugin-simple-import-sort";
7
+
8
+ // src/rules/importSortRules.ts
9
+ var importSortRules = {
10
+ "simple-import-sort/imports": [
11
+ "error",
12
+ {
13
+ groups: [
14
+ // External package imports
15
+ ["^\\w", "^@\\w"],
16
+ // @commencis package imports
17
+ ["^@commencis"],
18
+ // Config, util imports
19
+ ["(@/config|@/util)"],
20
+ // Type imports
21
+ ["@/type"],
22
+ // Absolute imports
23
+ ["^@/"],
24
+ // Relative imports
25
+ ["^\\.\\./", "^\\./"],
26
+ // Style imports
27
+ ["^.+\\.s?css$"]
28
+ ]
29
+ }
30
+ ],
31
+ "simple-import-sort/exports": "error"
32
+ };
33
+
34
+ // src/rules/nextPluginRules.ts
35
+ var nextPluginRules = {
36
+ // Breaks with ESLint 9, should be activated after the next plugin is updated
37
+ "@next/next/no-duplicate-head": "off"
38
+ };
39
+
40
+ // src/rules/reactHooksRules.ts
41
+ var reactHooksRules = {
42
+ "react-hooks/exhaustive-deps": "warn",
43
+ "react-hooks/rules-of-hooks": "error"
44
+ };
45
+
46
+ // src/rules/reactRules.ts
47
+ var reactRules = {
48
+ // Disable JS specific rules
49
+ "react/jsx-filename-extension": "off",
50
+ "react/default-props-match-prop-types": "off",
51
+ "react/prop-types": "off",
52
+ // Breaks @typescript-eslint/parser
53
+ "react/jsx-indent": "off",
54
+ "react/no-typos": "off",
55
+ "react/jsx-closing-tag-location": "off",
56
+ "react/jsx-wrap-multilines": "off",
57
+ // No longer necessary
58
+ // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
59
+ "react/jsx-uses-react": "off",
60
+ "react/react-in-jsx-scope": "off",
61
+ // We are not planning to utilize rules below
62
+ "react/jsx-props-no-spreading": "off"
63
+ };
64
+
65
+ // src/rules/typescriptRules.ts
66
+ var typescriptRules = {
67
+ "@typescript-eslint/consistent-type-definitions": "off",
68
+ "@typescript-eslint/no-empty-function": "off",
69
+ "@typescript-eslint/array-type": "off",
70
+ "@typescript-eslint/explicit-function-return-type": "error"
71
+ };
72
+
73
+ // src/plugins/importSortPlugin.ts
74
+ var importSortPluginConfig = {
75
+ name: "commencis/plugin:simple-import-sort",
76
+ plugins: {
77
+ "simple-import-sort": simpleImportSortPlugin
78
+ },
79
+ rules: {
80
+ ...importSortRules
81
+ }
82
+ };
83
+
84
+ // src/plugins/jsxA11yPlugin.ts
85
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
86
+
87
+ // src/constants/index.ts
88
+ var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
89
+
90
+ // src/plugins/jsxA11yPlugin.ts
91
+ var jsxA11yPluginConfig = {
92
+ name: "commencis/plugin:jsx-a11y",
93
+ files: JSX_TSX_FILE_PATTERNS,
94
+ plugins: {
95
+ "jsx-a11y": jsxA11yPlugin
96
+ },
97
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
98
+ rules: {
99
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
100
+ }
101
+ };
102
+
103
+ // src/plugins/nextPlugin.ts
104
+ import nextPlugin from "@next/eslint-plugin-next";
105
+ var nextPluginConfig = {
106
+ name: "commencis/plugin:next",
107
+ files: JSX_TSX_FILE_PATTERNS,
108
+ plugins: {
109
+ "@next/next": nextPlugin
110
+ },
111
+ rules: {
112
+ ...nextPlugin.configs.recommended.rules,
113
+ ...nextPlugin.configs["core-web-vitals"].rules,
114
+ ...nextPluginRules
115
+ },
116
+ ignores: [".next/*"]
117
+ };
118
+
119
+ // src/plugins/reactHooksPlugin.ts
120
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
121
+ var reactHooksPluginConfig = {
122
+ name: "commencis/plugin:react-hooks",
123
+ files: JSX_TSX_FILE_PATTERNS,
124
+ plugins: {
125
+ "react-hooks": reactHooksPlugin
126
+ },
127
+ rules: { ...reactHooksRules }
128
+ };
129
+
130
+ // src/plugins/reactPlugin.ts
131
+ import reactPlugin from "eslint-plugin-react";
132
+ var reactPluginConfig = {
133
+ name: "commencis/plugin:react",
134
+ files: JSX_TSX_FILE_PATTERNS,
135
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
136
+ plugins: {
137
+ react: reactPlugin
138
+ },
139
+ rules: {
140
+ ...reactPlugin.configs.flat.recommended.rules,
141
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
142
+ ...reactRules
143
+ },
144
+ settings: {
145
+ react: {
146
+ version: "detect"
147
+ }
148
+ }
149
+ };
150
+
151
+ // src/plugins/vuePlugin.ts
152
+ import vuePlugin from "eslint-plugin-vue";
153
+ var vuePluginConfig = [
154
+ ...vuePlugin.configs["flat/recommended"],
155
+ {
156
+ name: "commencis/plugin:vue"
157
+ }
158
+ ];
159
+
160
+ // src/configs/base.ts
161
+ var base_default = [
162
+ eslint.configs.recommended,
163
+ importSortPluginConfig,
164
+ {
165
+ name: "commencis/base",
166
+ languageOptions: {
167
+ ecmaVersion: 2022,
168
+ globals: {
169
+ ...globals.browser,
170
+ ...globals.es2021,
171
+ ...globals.node,
172
+ ...globals.serviceworker
173
+ }
174
+ },
175
+ rules: {
176
+ "no-console": "warn"
177
+ }
178
+ }
179
+ ];
180
+
181
+ // src/configs/prettier.ts
182
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
183
+ var prettier_default = [
184
+ eslintPluginPrettierRecommended,
185
+ { name: "commencis/prettier" }
186
+ ];
187
+
188
+ // src/configs/typescript.ts
189
+ import tseslint from "typescript-eslint";
190
+ var typescript_default = [
191
+ ...tseslint.configs.strict,
192
+ ...tseslint.configs.stylistic,
193
+ {
194
+ name: "commencis/typescript",
195
+ rules: {
196
+ ...typescriptRules
197
+ }
198
+ }
199
+ ];
200
+
201
+ // src/configs/react-native.ts
202
+ var react_native_default = [
203
+ ...base_default,
204
+ ...typescript_default,
205
+ reactPluginConfig,
206
+ reactHooksPluginConfig,
207
+ jsxA11yPluginConfig,
208
+ ...prettier_default,
209
+ { name: "commencis/react-native" }
210
+ ];
211
+ export {
212
+ react_native_default as default
213
+ };
@@ -1,4 +1,4 @@
1
- import { a as FlatConfigArray } from '../flatConfig-CFiBdxNB.js';
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
2
  import 'eslint';
3
3
 
4
4
  declare const _default: FlatConfigArray;
@@ -57,13 +57,17 @@ var reactRules = {
57
57
  // No longer necessary
58
58
  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
59
59
  "react/jsx-uses-react": "off",
60
- "react/react-in-jsx-scope": "off"
60
+ "react/react-in-jsx-scope": "off",
61
+ // We are not planning to utilize rules below
62
+ "react/jsx-props-no-spreading": "off"
61
63
  };
62
64
 
63
65
  // src/rules/typescriptRules.ts
64
66
  var typescriptRules = {
65
67
  "@typescript-eslint/consistent-type-definitions": "off",
66
- "@typescript-eslint/no-empty-function": "off"
68
+ "@typescript-eslint/no-empty-function": "off",
69
+ "@typescript-eslint/array-type": "off",
70
+ "@typescript-eslint/explicit-function-return-type": "error"
67
71
  };
68
72
 
69
73
  // src/plugins/importSortPlugin.ts
@@ -77,13 +81,27 @@ var importSortPluginConfig = {
77
81
  }
78
82
  };
79
83
 
80
- // src/plugins/nextPlugin.ts
81
- import nextPlugin from "@next/eslint-plugin-next";
84
+ // src/plugins/jsxA11yPlugin.ts
85
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
82
86
 
83
87
  // src/constants/index.ts
84
88
  var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
85
89
 
90
+ // src/plugins/jsxA11yPlugin.ts
91
+ var jsxA11yPluginConfig = {
92
+ name: "commencis/plugin:jsx-a11y",
93
+ files: JSX_TSX_FILE_PATTERNS,
94
+ plugins: {
95
+ "jsx-a11y": jsxA11yPlugin
96
+ },
97
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
98
+ rules: {
99
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
100
+ }
101
+ };
102
+
86
103
  // src/plugins/nextPlugin.ts
104
+ import nextPlugin from "@next/eslint-plugin-next";
87
105
  var nextPluginConfig = {
88
106
  name: "commencis/plugin:next",
89
107
  files: JSX_TSX_FILE_PATTERNS,
@@ -114,12 +132,13 @@ import reactPlugin from "eslint-plugin-react";
114
132
  var reactPluginConfig = {
115
133
  name: "commencis/plugin:react",
116
134
  files: JSX_TSX_FILE_PATTERNS,
117
- languageOptions: { ...reactPlugin.configs.recommended.languageOptions },
135
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
118
136
  plugins: {
119
137
  react: reactPlugin
120
138
  },
121
139
  rules: {
122
- ...reactPlugin.configs.recommended.rules,
140
+ ...reactPlugin.configs.flat.recommended.rules,
141
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
123
142
  ...reactRules
124
143
  },
125
144
  settings: {
@@ -185,6 +204,7 @@ var react_default = [
185
204
  ...typescript_default,
186
205
  reactPluginConfig,
187
206
  reactHooksPluginConfig,
207
+ jsxA11yPluginConfig,
188
208
  ...prettier_default,
189
209
  { name: "commencis/react" }
190
210
  ];
@@ -1,4 +1,4 @@
1
- import { a as FlatConfigArray } from '../flatConfig-CFiBdxNB.js';
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
2
  import 'eslint';
3
3
 
4
4
  declare const _default: FlatConfigArray;
@@ -4,7 +4,9 @@ import tseslint from "typescript-eslint";
4
4
  // src/rules/typescriptRules.ts
5
5
  var typescriptRules = {
6
6
  "@typescript-eslint/consistent-type-definitions": "off",
7
- "@typescript-eslint/no-empty-function": "off"
7
+ "@typescript-eslint/no-empty-function": "off",
8
+ "@typescript-eslint/array-type": "off",
9
+ "@typescript-eslint/explicit-function-return-type": "error"
8
10
  };
9
11
 
10
12
  // src/configs/typescript.ts
@@ -1,4 +1,4 @@
1
- import { a as FlatConfigArray } from '../flatConfig-CFiBdxNB.js';
1
+ import { a as FlatConfigArray } from '../flatConfig-Cm6wkwA_.js';
2
2
  import 'eslint';
3
3
 
4
4
  declare const _default: FlatConfigArray;
@@ -60,13 +60,17 @@ var reactRules = {
60
60
  // No longer necessary
61
61
  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
62
62
  "react/jsx-uses-react": "off",
63
- "react/react-in-jsx-scope": "off"
63
+ "react/react-in-jsx-scope": "off",
64
+ // We are not planning to utilize rules below
65
+ "react/jsx-props-no-spreading": "off"
64
66
  };
65
67
 
66
68
  // src/rules/typescriptRules.ts
67
69
  var typescriptRules = {
68
70
  "@typescript-eslint/consistent-type-definitions": "off",
69
- "@typescript-eslint/no-empty-function": "off"
71
+ "@typescript-eslint/no-empty-function": "off",
72
+ "@typescript-eslint/array-type": "off",
73
+ "@typescript-eslint/explicit-function-return-type": "error"
70
74
  };
71
75
 
72
76
  // src/plugins/importSortPlugin.ts
@@ -80,13 +84,27 @@ var importSortPluginConfig = {
80
84
  }
81
85
  };
82
86
 
83
- // src/plugins/nextPlugin.ts
84
- import nextPlugin from "@next/eslint-plugin-next";
87
+ // src/plugins/jsxA11yPlugin.ts
88
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
85
89
 
86
90
  // src/constants/index.ts
87
91
  var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
88
92
 
93
+ // src/plugins/jsxA11yPlugin.ts
94
+ var jsxA11yPluginConfig = {
95
+ name: "commencis/plugin:jsx-a11y",
96
+ files: JSX_TSX_FILE_PATTERNS,
97
+ plugins: {
98
+ "jsx-a11y": jsxA11yPlugin
99
+ },
100
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
101
+ rules: {
102
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
103
+ }
104
+ };
105
+
89
106
  // src/plugins/nextPlugin.ts
107
+ import nextPlugin from "@next/eslint-plugin-next";
90
108
  var nextPluginConfig = {
91
109
  name: "commencis/plugin:next",
92
110
  files: JSX_TSX_FILE_PATTERNS,
@@ -117,12 +135,13 @@ import reactPlugin from "eslint-plugin-react";
117
135
  var reactPluginConfig = {
118
136
  name: "commencis/plugin:react",
119
137
  files: JSX_TSX_FILE_PATTERNS,
120
- languageOptions: { ...reactPlugin.configs.recommended.languageOptions },
138
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
121
139
  plugins: {
122
140
  react: reactPlugin
123
141
  },
124
142
  rules: {
125
- ...reactPlugin.configs.recommended.rules,
143
+ ...reactPlugin.configs.flat.recommended.rules,
144
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
126
145
  ...reactRules
127
146
  },
128
147
  settings: {
@@ -10,7 +10,7 @@ import { Linter } from 'eslint';
10
10
  * @see Using plugins in your configuration]
11
11
  * (https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
12
12
  */
13
- type FlatConfig = Omit<Linter.FlatConfig<Linter.RulesRecord>, 'plugins'> & {
13
+ type FlatConfig = Omit<Linter.Config, 'plugins'> & {
14
14
  plugins?: Record<string, unknown>;
15
15
  };
16
16
  type FlatConfigArray = FlatConfig[];
package/dist/index.d.ts CHANGED
@@ -3,10 +3,11 @@ export { default as commencisBaseConfig } from './configs/base.js';
3
3
  export { default as commencisNextConfig } from './configs/next.js';
4
4
  export { default as commencisPrettierConfig } from './configs/prettier.js';
5
5
  export { default as commencisReactConfig } from './configs/react.js';
6
+ export { default as commencisReactNativeConfig } from './configs/react-native.js';
6
7
  export { default as commencisTypescriptConfig } from './configs/typescript.js';
7
8
  export { default as commencisVueConfig } from './configs/vue.js';
8
9
  import 'eslint';
9
- import './flatConfig-CFiBdxNB.js';
10
+ import './flatConfig-Cm6wkwA_.js';
10
11
 
11
12
  declare const defineConfig: typeof typescript_eslint.config;
12
13
 
package/dist/index.js CHANGED
@@ -60,13 +60,17 @@ var reactRules = {
60
60
  // No longer necessary
61
61
  // https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
62
62
  "react/jsx-uses-react": "off",
63
- "react/react-in-jsx-scope": "off"
63
+ "react/react-in-jsx-scope": "off",
64
+ // We are not planning to utilize rules below
65
+ "react/jsx-props-no-spreading": "off"
64
66
  };
65
67
 
66
68
  // src/rules/typescriptRules.ts
67
69
  var typescriptRules = {
68
70
  "@typescript-eslint/consistent-type-definitions": "off",
69
- "@typescript-eslint/no-empty-function": "off"
71
+ "@typescript-eslint/no-empty-function": "off",
72
+ "@typescript-eslint/array-type": "off",
73
+ "@typescript-eslint/explicit-function-return-type": "error"
70
74
  };
71
75
 
72
76
  // src/plugins/importSortPlugin.ts
@@ -80,13 +84,27 @@ var importSortPluginConfig = {
80
84
  }
81
85
  };
82
86
 
83
- // src/plugins/nextPlugin.ts
84
- import nextPlugin from "@next/eslint-plugin-next";
87
+ // src/plugins/jsxA11yPlugin.ts
88
+ import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
85
89
 
86
90
  // src/constants/index.ts
87
91
  var JSX_TSX_FILE_PATTERNS = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
88
92
 
93
+ // src/plugins/jsxA11yPlugin.ts
94
+ var jsxA11yPluginConfig = {
95
+ name: "commencis/plugin:jsx-a11y",
96
+ files: JSX_TSX_FILE_PATTERNS,
97
+ plugins: {
98
+ "jsx-a11y": jsxA11yPlugin
99
+ },
100
+ languageOptions: { ...jsxA11yPlugin.flatConfigs.recommended.languageOptions },
101
+ rules: {
102
+ ...jsxA11yPlugin.flatConfigs.recommended.rules
103
+ }
104
+ };
105
+
89
106
  // src/plugins/nextPlugin.ts
107
+ import nextPlugin from "@next/eslint-plugin-next";
90
108
  var nextPluginConfig = {
91
109
  name: "commencis/plugin:next",
92
110
  files: JSX_TSX_FILE_PATTERNS,
@@ -117,12 +135,13 @@ import reactPlugin from "eslint-plugin-react";
117
135
  var reactPluginConfig = {
118
136
  name: "commencis/plugin:react",
119
137
  files: JSX_TSX_FILE_PATTERNS,
120
- languageOptions: { ...reactPlugin.configs.recommended.languageOptions },
138
+ languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions },
121
139
  plugins: {
122
140
  react: reactPlugin
123
141
  },
124
142
  rules: {
125
- ...reactPlugin.configs.recommended.rules,
143
+ ...reactPlugin.configs.flat.recommended.rules,
144
+ ...reactPlugin.configs.flat["jsx-runtime"].rules,
126
145
  ...reactRules
127
146
  },
128
147
  settings: {
@@ -188,6 +207,7 @@ var next_default = [
188
207
  ...typescript_default,
189
208
  reactPluginConfig,
190
209
  reactHooksPluginConfig,
210
+ jsxA11yPluginConfig,
191
211
  nextPluginConfig,
192
212
  ...prettier_default,
193
213
  { name: "commencis/next" }
@@ -199,10 +219,22 @@ var react_default = [
199
219
  ...typescript_default,
200
220
  reactPluginConfig,
201
221
  reactHooksPluginConfig,
222
+ jsxA11yPluginConfig,
202
223
  ...prettier_default,
203
224
  { name: "commencis/react" }
204
225
  ];
205
226
 
227
+ // src/configs/react-native.ts
228
+ var react_native_default = [
229
+ ...base_default,
230
+ ...typescript_default,
231
+ reactPluginConfig,
232
+ reactHooksPluginConfig,
233
+ jsxA11yPluginConfig,
234
+ ...prettier_default,
235
+ { name: "commencis/react-native" }
236
+ ];
237
+
206
238
  // src/configs/vue.ts
207
239
  import tseslint2 from "typescript-eslint";
208
240
  var vue_default = [
@@ -232,6 +264,7 @@ export {
232
264
  next_default as commencisNextConfig,
233
265
  prettier_default as commencisPrettierConfig,
234
266
  react_default as commencisReactConfig,
267
+ react_native_default as commencisReactNativeConfig,
235
268
  typescript_default as commencisTypescriptConfig,
236
269
  vue_default as commencisVueConfig,
237
270
  defineConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commencis/eslint-config",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Commencis ESLint config",
5
5
  "author": "Commencis WEB Team",
6
6
  "license": "Apache-2.0",
@@ -25,56 +25,60 @@
25
25
  ],
26
26
  "exports": {
27
27
  ".": {
28
- "import": "./dist/index.js",
29
- "types": "./dist/index.d.ts"
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
30
  },
31
31
  "./base": {
32
- "import": "./dist/configs/base.js",
33
- "types": "./dist/configs/base.d.ts"
32
+ "types": "./dist/configs/base.d.ts",
33
+ "import": "./dist/configs/base.js"
34
34
  },
35
35
  "./next": {
36
- "import": "./dist/configs/next.js",
37
- "types": "./dist/configs/next.d.ts"
36
+ "types": "./dist/configs/next.d.ts",
37
+ "import": "./dist/configs/next.js"
38
38
  },
39
39
  "./prettier": {
40
- "import": "./dist/configs/prettier.js",
41
- "types": "./dist/configs/prettier.d.ts"
40
+ "types": "./dist/configs/prettier.d.ts",
41
+ "import": "./dist/configs/prettier.js"
42
42
  },
43
43
  "./react": {
44
- "import": "./dist/configs/react.js",
45
- "types": "./dist/configs/react.d.ts"
44
+ "types": "./dist/configs/react.d.ts",
45
+ "import": "./dist/configs/react.js"
46
+ },
47
+ "./react-native": {
48
+ "types": "./dist/configs/react-native.d.ts",
49
+ "import": "./dist/configs/react-native.js"
46
50
  },
47
51
  "./typescript": {
48
- "import": "./dist/configs/typescript.js",
49
- "types": "./dist/configs/typescript.d.ts"
52
+ "types": "./dist/configs/typescript.d.ts",
53
+ "import": "./dist/configs/typescript.js"
50
54
  },
51
55
  "./vue": {
52
- "import": "./dist/configs/vue.js",
53
- "types": "./dist/configs/vue.d.ts"
56
+ "types": "./dist/configs/vue.d.ts",
57
+ "import": "./dist/configs/vue.js"
54
58
  }
55
59
  },
56
60
  "dependencies": {
57
- "@eslint/js": "9.6.0",
58
- "@next/eslint-plugin-next": "14.2.4",
59
- "@typescript-eslint/utils": "8.0.0-alpha.30",
61
+ "@eslint/js": "9.13.0",
62
+ "@next/eslint-plugin-next": "15.0.0",
63
+ "@typescript-eslint/utils": "8.11.0",
60
64
  "eslint-config-prettier": "9.1.0",
61
- "eslint-plugin-jsx-a11y": "6.9.0",
62
- "eslint-plugin-prettier": "5.1.3",
63
- "eslint-plugin-react": "7.34.3",
64
- "eslint-plugin-react-hooks": "4.6.2",
65
- "eslint-plugin-simple-import-sort": "12.1.0",
66
- "eslint-plugin-vue": "9.26.0",
67
- "globals": "15.6.0",
68
- "typescript-eslint": "8.0.0-alpha.30"
65
+ "eslint-plugin-jsx-a11y": "6.10.1",
66
+ "eslint-plugin-prettier": "5.2.1",
67
+ "eslint-plugin-react": "7.37.1",
68
+ "eslint-plugin-react-hooks": "5.0.0",
69
+ "eslint-plugin-simple-import-sort": "12.1.1",
70
+ "eslint-plugin-vue": "9.29.1",
71
+ "globals": "15.11.0",
72
+ "typescript-eslint": "8.11.0"
69
73
  },
70
74
  "devDependencies": {
71
75
  "@types/eslint__js": "8.42.3",
72
- "tsup": "8.1.0",
73
- "typescript": "5.4.5",
74
- "@commencis/ts-config": "0.0.1"
76
+ "tsup": "8.3.0",
77
+ "typescript": "5.6.3",
78
+ "@commencis/ts-config": "0.0.2"
75
79
  },
76
80
  "peerDependencies": {
77
- "eslint": ">= 9"
81
+ "eslint": ">= 9.7"
78
82
  },
79
83
  "scripts": {
80
84
  "dev": "tsup --watch",