@siberiacancode/eslint 2.2.0 → 2.3.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.
Files changed (3) hide show
  1. package/index.d.ts +19 -19
  2. package/index.js +150 -149
  3. package/package.json +11 -11
package/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- declare module '@siberiacancode/eslint' {
2
- declare type Eslint = (
3
- options?: import('@antfu/eslint-config').OptionsConfig & {
4
- jsxA11y?: boolean;
5
- next?: boolean;
6
- } & import('@antfu/eslint-config').TypedFlatConfigItem,
7
- ...userConfigs: import('@antfu/eslint-config').Awaitable<
8
- | import('@antfu/eslint-config').TypedFlatConfigItem
9
- | import('@antfu/eslint-config').TypedFlatConfigItem[]
10
- | import('@antfu/eslint-config').FlatConfigComposer<any, any>
11
- | Linter.Config[]
12
- >[]
13
- ) => import('@antfu/eslint-config').FlatConfigComposer<
14
- import('@antfu/eslint-config').TypedFlatConfigItem,
15
- import('@antfu/eslint-config').ConfigNames
16
- >;
17
-
18
- export const eslint: Eslint;
19
- }
1
+ declare module '@siberiacancode/eslint' {
2
+ declare type Eslint = (
3
+ options?: import('@antfu/eslint-config').OptionsConfig & {
4
+ jsxA11y?: boolean;
5
+ next?: boolean;
6
+ } & import('@antfu/eslint-config').TypedFlatConfigItem,
7
+ ...userConfigs: import('@antfu/eslint-config').Awaitable<
8
+ | import('@antfu/eslint-config').TypedFlatConfigItem
9
+ | import('@antfu/eslint-config').TypedFlatConfigItem[]
10
+ | import('@antfu/eslint-config').FlatConfigComposer<any, any>
11
+ | Linter.Config[]
12
+ >[]
13
+ ) => import('@antfu/eslint-config').FlatConfigComposer<
14
+ import('@antfu/eslint-config').TypedFlatConfigItem,
15
+ import('@antfu/eslint-config').ConfigNames
16
+ >;
17
+
18
+ export const eslint: Eslint;
19
+ }
package/index.js CHANGED
@@ -1,149 +1,150 @@
1
- import antfu from '@antfu/eslint-config';
2
- import pluginNext from '@next/eslint-plugin-next';
3
- import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
4
- import pluginReact from 'eslint-plugin-react';
5
- import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
6
-
7
- /** @type {import('@siberiacancode/eslint').Eslint} */
8
- export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs) => {
9
- const stylistic = options.stylistic ?? false;
10
-
11
- if (next) {
12
- configs.unshift({
13
- plugins: {
14
- 'siberiacancode-next': pluginNext
15
- },
16
- name: 'siberiacancode/next',
17
- rules: {
18
- ...Object.entries({ ...pluginNext.configs.recommended.rules }).reduce(
19
- (acc, [key, value]) => {
20
- acc[key.replace('@next/next', 'siberiacancode-next')] = value;
21
- return acc;
22
- },
23
- {}
24
- )
25
- }
26
- });
27
- }
28
-
29
- if (jsxA11y) {
30
- configs.unshift({
31
- plugins: {
32
- 'siberiacancode-jsx-a11y': pluginJsxA11y
33
- },
34
- name: 'siberiacancode/jsx-a11y',
35
- rules: {
36
- ...Object.entries(pluginJsxA11y.flatConfigs.recommended.rules).reduce(
37
- (acc, [key, value]) => {
38
- acc[key.replace('jsx-a11y', 'siberiacancode-jsx-a11y')] = value;
39
- return acc;
40
- },
41
- {}
42
- )
43
- }
44
- });
45
- }
46
-
47
- if (options.react) {
48
- configs.unshift({
49
- name: 'siberiacancode/react',
50
- plugins: {
51
- 'siberiacancode-react': pluginReact
52
- },
53
- settings: {
54
- react: {
55
- version: 'detect'
56
- }
57
- },
58
- rules: {
59
- ...Object.entries(pluginReact.configs.recommended.rules).reduce((acc, [key, value]) => {
60
- acc[key.replace('react', 'siberiacancode-react')] = value;
61
- return acc;
62
- }, {}),
63
- 'siberiacancode-react/react-in-jsx-scope': 'off',
64
- 'siberiacancode-react/function-component-definition': [
65
- 'error',
66
- {
67
- namedComponents: ['arrow-function'],
68
- unnamedComponents: 'arrow-function'
69
- }
70
- ]
71
- }
72
- });
73
- }
74
-
75
- if (stylistic) {
76
- configs.unshift({
77
- name: 'siberiacancode/formatter',
78
- rules: {
79
- 'style/multiline-ternary': 'off',
80
- 'style/jsx-curly-newline': 'off',
81
- 'style/jsx-one-expression-per-line': 'off',
82
- 'style/member-delimiter-style': 'off',
83
- 'style/quote-props': 'off',
84
- 'style/operator-linebreak': 'off',
85
- 'style/brace-style': 'off',
86
-
87
- 'style/max-len': [
88
- 'error',
89
- 100,
90
- 2,
91
- { ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
92
- ],
93
- 'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
94
- 'style/jsx-quotes': ['error', 'prefer-single'],
95
- 'style/comma-dangle': ['error', 'never'],
96
- 'style/semi': ['error', 'always'],
97
- 'style/indent': ['error', 2, { SwitchCase: 1 }],
98
- 'style/no-tabs': 'error',
99
- 'style/linebreak-style': ['error', 'unix'],
100
- 'style/arrow-parens': ['error', 'always']
101
- }
102
- });
103
- }
104
-
105
- return antfu(
106
- { ...options, stylistic },
107
- {
108
- name: 'siberiacancode/rewrite',
109
- rules: {
110
- 'antfu/top-level-function': 'off',
111
- 'antfu/if-newline': 'off',
112
- 'antfu/curly': 'off',
113
-
114
- 'react-hooks/exhaustive-deps': 'off',
115
-
116
- 'test/prefer-lowercase-title': 'off',
117
-
118
- 'no-console': 'warn'
119
- }
120
- },
121
- {
122
- name: 'siberiacancode/imports',
123
- plugins: {
124
- 'plugin-simple-import-sort': pluginSimpleImportSort
125
- },
126
- rules: {
127
- 'sort-imports': 'off',
128
- 'import/order': 'off',
129
- 'import/extensions': 'off',
130
- 'plugin-simple-import-sort/exports': 'error',
131
- 'plugin-simple-import-sort/imports': [
132
- 'error',
133
- {
134
- groups: [
135
- ['^react', '^@?\\w'],
136
- ['^@(siberiacancode-core/.*|$)'],
137
- ['^@(([\\/.]?\\w)|assets|test-utils)'],
138
- ['^\\u0000'],
139
- ['^\\.\\.(?!/?$)', '^\\.\\./?$'],
140
- ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
141
- ['^.+\\.s?css$']
142
- ]
143
- }
144
- ]
145
- }
146
- },
147
- ...configs
148
- );
149
- };
1
+ import antfu from '@antfu/eslint-config';
2
+ import pluginNext from '@next/eslint-plugin-next';
3
+ import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
4
+ import pluginReact from 'eslint-plugin-react';
5
+ import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
6
+
7
+ /** @type {import('@siberiacancode/eslint').Eslint} */
8
+ export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs) => {
9
+ const stylistic = options?.stylistic ?? false;
10
+
11
+ if (next) {
12
+ configs.unshift({
13
+ plugins: {
14
+ 'siberiacancode-next': pluginNext
15
+ },
16
+ name: 'siberiacancode/next',
17
+ rules: {
18
+ ...Object.entries({ ...pluginNext.configs.recommended.rules }).reduce(
19
+ (acc, [key, value]) => {
20
+ acc[key.replace('@next/next', 'siberiacancode-next')] = value;
21
+ return acc;
22
+ },
23
+ {}
24
+ )
25
+ }
26
+ });
27
+ }
28
+
29
+ if (jsxA11y) {
30
+ configs.unshift({
31
+ plugins: {
32
+ 'siberiacancode-jsx-a11y': pluginJsxA11y
33
+ },
34
+ name: 'siberiacancode/jsx-a11y',
35
+ rules: {
36
+ ...Object.entries(pluginJsxA11y.flatConfigs.recommended.rules).reduce(
37
+ (acc, [key, value]) => {
38
+ acc[key.replace('jsx-a11y', 'siberiacancode-jsx-a11y')] = value;
39
+ return acc;
40
+ },
41
+ {}
42
+ )
43
+ }
44
+ });
45
+ }
46
+
47
+ if (options.react) {
48
+ configs.unshift({
49
+ name: 'siberiacancode/react',
50
+ plugins: {
51
+ 'siberiacancode-react': pluginReact
52
+ },
53
+ settings: {
54
+ react: {
55
+ version: 'detect'
56
+ }
57
+ },
58
+ rules: {
59
+ ...Object.entries(pluginReact.configs.recommended.rules).reduce((acc, [key, value]) => {
60
+ acc[key.replace('react', 'siberiacancode-react')] = value;
61
+ return acc;
62
+ }, {}),
63
+ 'siberiacancode-react/prop-types': 'off',
64
+ 'siberiacancode-react/react-in-jsx-scope': 'off',
65
+ 'siberiacancode-react/function-component-definition': [
66
+ 'error',
67
+ {
68
+ namedComponents: ['arrow-function'],
69
+ unnamedComponents: 'arrow-function'
70
+ }
71
+ ]
72
+ }
73
+ });
74
+ }
75
+
76
+ if (stylistic) {
77
+ configs.unshift({
78
+ name: 'siberiacancode/formatter',
79
+ rules: {
80
+ 'style/multiline-ternary': 'off',
81
+ 'style/jsx-curly-newline': 'off',
82
+ 'style/jsx-one-expression-per-line': 'off',
83
+ 'style/member-delimiter-style': 'off',
84
+ 'style/quote-props': 'off',
85
+ 'style/operator-linebreak': 'off',
86
+ 'style/brace-style': 'off',
87
+
88
+ 'style/max-len': [
89
+ 'error',
90
+ 100,
91
+ 2,
92
+ { ignoreComments: true, ignoreStrings: true, ignoreTemplateLiterals: true }
93
+ ],
94
+ 'style/quotes': ['error', 'single', { allowTemplateLiterals: true }],
95
+ 'style/jsx-quotes': ['error', 'prefer-single'],
96
+ 'style/comma-dangle': ['error', 'never'],
97
+ 'style/semi': ['error', 'always'],
98
+ 'style/indent': ['error', 2, { SwitchCase: 1 }],
99
+ 'style/no-tabs': 'error',
100
+ 'style/linebreak-style': ['error', 'unix'],
101
+ 'style/arrow-parens': ['error', 'always']
102
+ }
103
+ });
104
+ }
105
+
106
+ return antfu(
107
+ { ...options, stylistic },
108
+ {
109
+ name: 'siberiacancode/rewrite',
110
+ rules: {
111
+ 'antfu/top-level-function': 'off',
112
+ 'antfu/if-newline': 'off',
113
+ 'antfu/curly': 'off',
114
+
115
+ 'react-hooks/exhaustive-deps': 'off',
116
+
117
+ 'test/prefer-lowercase-title': 'off',
118
+
119
+ 'no-console': 'warn'
120
+ }
121
+ },
122
+ {
123
+ name: 'siberiacancode/imports',
124
+ plugins: {
125
+ 'plugin-simple-import-sort': pluginSimpleImportSort
126
+ },
127
+ rules: {
128
+ 'sort-imports': 'off',
129
+ 'import/order': 'off',
130
+ 'import/extensions': 'off',
131
+ 'plugin-simple-import-sort/exports': 'error',
132
+ 'plugin-simple-import-sort/imports': [
133
+ 'error',
134
+ {
135
+ groups: [
136
+ ['^react', '^@?\\w'],
137
+ ['^@(siberiacancode-core/.*|$)'],
138
+ ['^@(([\\/.]?\\w)|assets|test-utils)'],
139
+ ['^\\u0000'],
140
+ ['^\\.\\.(?!/?$)', '^\\.\\./?$'],
141
+ ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
142
+ ['^.+\\.s?css$']
143
+ ]
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ ...configs
149
+ );
150
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@siberiacancode/eslint",
3
3
  "type": "module",
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "description": "eslint configs",
6
6
  "author": {
7
7
  "name": "SIBERIA CAN CODE 🧊",
@@ -35,18 +35,18 @@
35
35
  "lint-inspector": "npx @eslint/config-inspector"
36
36
  },
37
37
  "peerDependencies": {
38
- "eslint": "^9.9.0"
38
+ "eslint": "^9.14.0"
39
39
  },
40
40
  "dependencies": {
41
- "@antfu/eslint-config": "^2.25.1",
42
- "@eslint-react/eslint-plugin": "^1.10.0",
43
- "@next/eslint-plugin-next": "^14.2.5",
44
- "@vue/compiler-sfc": "^3.4.38",
45
- "eslint": "^9.9.0",
46
- "eslint-plugin-jsx-a11y": "^6.9.0",
47
- "eslint-plugin-react": "^7.35.0",
48
- "eslint-plugin-react-hooks": "^4.6.2",
49
- "eslint-plugin-react-refresh": "^0.4.9",
41
+ "@antfu/eslint-config": "^3.8.0",
42
+ "@eslint-react/eslint-plugin": "^1.15.2",
43
+ "@next/eslint-plugin-next": "^15.0.2",
44
+ "@vue/compiler-sfc": "^3.5.12",
45
+ "eslint": "^9.14.0",
46
+ "eslint-plugin-jsx-a11y": "^6.10.2",
47
+ "eslint-plugin-react": "^7.37.2",
48
+ "eslint-plugin-react-hooks": "^5.0.0",
49
+ "eslint-plugin-react-refresh": "^0.4.14",
50
50
  "eslint-plugin-simple-import-sort": "^12.1.1"
51
51
  },
52
52
  "devDependencies": {