@seahax/config-eslint 0.2.1 → 0.3.1

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 CHANGED
@@ -1,2 +1,6 @@
1
- declare const _default: import("eslint/config").Config[];
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,66 @@
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
- import prettierPlugin from 'eslint-plugin-prettier/recommended';
5
+ import prettierPluginRecommended 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 defineConfig({
10
- ignores: ['**/{node_modules,lib,dist,out,coverage}'],
11
- }, progress(), js.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic, regexp.configs.recommended, prettierPlugin, prettierConfig, {
12
- plugins: {
13
- 'simple-import-sort': simpleImportSort,
14
- },
15
- rules: {
16
- 'no-undef': 'off',
17
- '@typescript-eslint/ban-types': 'off',
18
- '@typescript-eslint/no-empty-object-type': 'off',
19
- '@typescript-eslint/no-explicit-any': 'off',
20
- '@typescript-eslint/prefer-function-type': 'off',
21
- 'simple-import-sort/imports': 'warn',
22
- 'simple-import-sort/exports': 'warn',
23
- 'prettier/prettier': 'warn',
24
- },
25
- });
26
- function progress() {
27
- return {
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
+ }, regexp.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic, {
17
+ rules: {
18
+ '@typescript-eslint/ban-types': 'off',
19
+ '@typescript-eslint/no-empty-object-type': 'off',
20
+ '@typescript-eslint/no-explicit-any': 'off',
21
+ '@typescript-eslint/prefer-function-type': 'off',
22
+ },
23
+ }, {
28
24
  plugins: {
29
- progress: {
30
- rules: {
31
- progress: {
32
- create(context) {
33
- console.log(`eslint: ${path.relative(context.cwd, context.filename)}`);
34
- return {};
25
+ 'simple-import-sort': simpleImportSort,
26
+ },
27
+ rules: {
28
+ 'simple-import-sort/imports': 'warn',
29
+ 'simple-import-sort/exports': 'warn',
30
+ },
31
+ }, prettierPluginRecommended, {
32
+ rules: {
33
+ 'prettier/prettier': 'warn',
34
+ },
35
+ },
36
+ // Intentionally added after prettier, but with rules that should
37
+ // be compatible with prettier
38
+ stylistic.configs.customize({
39
+ commaDangle: 'always-multiline',
40
+ braceStyle: '1tbs',
41
+ indent,
42
+ quotes: 'single',
43
+ arrowParens: true,
44
+ semi: true,
45
+ severity: 'warn',
46
+ }));
47
+ function progress() {
48
+ return {
49
+ plugins: {
50
+ progress: {
51
+ rules: {
52
+ progress: {
53
+ create(context) {
54
+ console.log(`eslint: ${path.relative(context.cwd, context.filename)}`);
55
+ return {};
56
+ },
35
57
  },
36
58
  },
37
59
  },
38
60
  },
39
- },
40
- rules: {
41
- 'progress/progress': 1,
42
- },
43
- };
44
- }
61
+ rules: {
62
+ 'progress/progress': 1,
63
+ },
64
+ };
65
+ }
66
+ };
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.2.1"
35
+ "version": "0.3.1"
33
36
  }