@siberiacancode/eslint 2.1.0 → 2.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/README.md +3 -3
- package/index.d.ts +2 -1
- package/index.js +21 -2
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# 🔮 eslint configs
|
|
2
|
-
|
|
3
|
-
Пакет содержит eslint конфиг
|
|
1
|
+
# 🔮 eslint configs
|
|
2
|
+
|
|
3
|
+
Пакет содержит eslint конфиг
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
declare module '@siberiacancode/eslint' {
|
|
2
2
|
declare type Eslint = (
|
|
3
3
|
options?: import('@antfu/eslint-config').OptionsConfig & {
|
|
4
|
-
|
|
4
|
+
jsxA11y?: boolean;
|
|
5
|
+
next?: boolean;
|
|
5
6
|
} & import('@antfu/eslint-config').TypedFlatConfigItem,
|
|
6
7
|
...userConfigs: import('@antfu/eslint-config').Awaitable<
|
|
7
8
|
| import('@antfu/eslint-config').TypedFlatConfigItem
|
package/index.js
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
import antfu from '@antfu/eslint-config';
|
|
2
|
+
import pluginNext from '@next/eslint-plugin-next';
|
|
2
3
|
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
|
|
3
4
|
import pluginReact from 'eslint-plugin-react';
|
|
4
5
|
import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
5
6
|
|
|
6
7
|
/** @type {import('@siberiacancode/eslint').Eslint} */
|
|
7
|
-
export const eslint = (options, ...configs) => {
|
|
8
|
+
export const eslint = ({ jsxA11y = false, next = false, ...options }, ...configs) => {
|
|
8
9
|
const stylistic = options.stylistic ?? false;
|
|
9
10
|
|
|
10
|
-
if (
|
|
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) {
|
|
11
30
|
configs.unshift({
|
|
12
31
|
plugins: {
|
|
13
32
|
'siberiacancode-jsx-a11y': pluginJsxA11y
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siberiacancode/eslint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"description": "eslint configs",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SIBERIA CAN CODE 🧊",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@antfu/eslint-config": "^2.25.1",
|
|
42
42
|
"@eslint-react/eslint-plugin": "^1.10.0",
|
|
43
|
+
"@next/eslint-plugin-next": "^14.2.5",
|
|
44
|
+
"@vue/compiler-sfc": "^3.4.38",
|
|
43
45
|
"eslint": "^9.9.0",
|
|
44
46
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
45
47
|
"eslint-plugin-react": "^7.35.0",
|