@seahax/config-eslint 0.2.0 → 0.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.
- package/dist/index.d.ts +5 -1
- package/dist/index.js +51 -32
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export interface Options {
|
|
2
|
+
/** Stylistic indent in spaces (2 by default - should match prettier) */
|
|
3
|
+
readonly indent?: number;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: ({ indent }?: Options) => import("eslint/config").Config[];
|
|
2
6
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,63 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import js from '@eslint/js';
|
|
3
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
3
4
|
import { defineConfig } from 'eslint/config';
|
|
4
|
-
import prettierConfig from 'eslint-config-prettier';
|
|
5
5
|
import prettierPlugin from 'eslint-plugin-prettier/recommended';
|
|
6
6
|
import regexp from 'eslint-plugin-regexp';
|
|
7
7
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
8
8
|
import tseslint from 'typescript-eslint';
|
|
9
|
-
export default
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
export default ({ indent = 2 } = {}) => {
|
|
10
|
+
return defineConfig(progress(), {
|
|
11
|
+
ignores: ['**/{node_modules,lib,dist,out,coverage}'],
|
|
12
|
+
}, js.configs.recommended, {
|
|
13
|
+
rules: {
|
|
14
|
+
'no-undef': 'off',
|
|
15
|
+
},
|
|
16
|
+
}, stylistic.configs.customize({
|
|
17
|
+
commaDangle: 'always-multiline',
|
|
18
|
+
braceStyle: '1tbs',
|
|
19
|
+
indent,
|
|
20
|
+
quotes: 'single',
|
|
21
|
+
arrowParens: true,
|
|
22
|
+
semi: true,
|
|
23
|
+
severity: 'warn',
|
|
24
|
+
}), regexp.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic, {
|
|
25
|
+
rules: {
|
|
26
|
+
'@typescript-eslint/ban-types': 'off',
|
|
27
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
28
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
29
|
+
'@typescript-eslint/prefer-function-type': 'off',
|
|
30
|
+
},
|
|
31
|
+
}, {
|
|
28
32
|
plugins: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
'simple-import-sort': simpleImportSort,
|
|
34
|
+
},
|
|
35
|
+
rules: {
|
|
36
|
+
'simple-import-sort/imports': 'warn',
|
|
37
|
+
'simple-import-sort/exports': 'warn',
|
|
38
|
+
},
|
|
39
|
+
}, prettierPlugin, {
|
|
40
|
+
rules: {
|
|
41
|
+
'prettier/prettier': 'warn',
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
function progress() {
|
|
45
|
+
return {
|
|
46
|
+
plugins: {
|
|
47
|
+
progress: {
|
|
48
|
+
rules: {
|
|
49
|
+
progress: {
|
|
50
|
+
create(context) {
|
|
51
|
+
console.log(`eslint: ${path.relative(context.cwd, context.filename)}`);
|
|
52
|
+
return {};
|
|
53
|
+
},
|
|
35
54
|
},
|
|
36
55
|
},
|
|
37
56
|
},
|
|
38
57
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
58
|
+
rules: {
|
|
59
|
+
'progress/progress': 1,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seahax/config-eslint",
|
|
3
3
|
"description": "Base ESLint config for Typescript+Prettier.",
|
|
4
|
-
"homepage": "https://git.sr.ht/~seahax/config-eslint",
|
|
4
|
+
"homepage": "https://git.sr.ht/~seahax/npm-config-eslint",
|
|
5
5
|
"license": "MIT-0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -19,15 +19,18 @@
|
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@eslint/js": "^9.39.4",
|
|
22
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
22
23
|
"eslint": "^9.39.4",
|
|
23
24
|
"eslint-config-prettier": "^10.1.8",
|
|
24
25
|
"eslint-plugin-prettier": "^5.5.5",
|
|
25
26
|
"eslint-plugin-regexp": "^3.1.0",
|
|
26
27
|
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
28
|
+
"prettier": ">=3.0.0",
|
|
29
|
+
"typescript": ">=5.0.0",
|
|
27
30
|
"typescript-eslint": "^8.59.1"
|
|
28
31
|
},
|
|
29
32
|
"publishConfig": {
|
|
30
33
|
"access": "public"
|
|
31
34
|
},
|
|
32
|
-
"version": "0.
|
|
35
|
+
"version": "0.3.0"
|
|
33
36
|
}
|