@d-zero/eslint-config 5.0.0-dev.73 → 5.0.0-dev.84

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/base.js +80 -0
  2. package/index.js +67 -139
  3. package/package.json +19 -10
package/base.js ADDED
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @type {import('eslint/lib/shared/types').ConfigData}
3
+ */
4
+ module.exports = {
5
+ extends: ['eslint:recommended', 'plugin:import/recommended'],
6
+ env: {
7
+ browser: true,
8
+ es6: true,
9
+ node: true,
10
+ },
11
+ plugins: ['jsdoc', 'eslint-comments', 'import', 'sort-class-members'],
12
+ parserOptions: {
13
+ ecmaVersion: 2023,
14
+ },
15
+ globals: {
16
+ NodeJS: true,
17
+ },
18
+ rules: {
19
+ // Standard
20
+ 'no-var': 2,
21
+ 'no-unused-vars': 0,
22
+ 'no-console': 'warn',
23
+ 'no-mixed-spaces-and-tabs': 0,
24
+
25
+ // import
26
+ 'import/no-named-as-default': 0,
27
+ 'import/no-unresolved': 0,
28
+ 'import/no-extraneous-dependencies': 2,
29
+ 'import/order': [
30
+ 2,
31
+ {
32
+ groups: ['type', 'builtin', 'external', 'parent', 'sibling', 'index', 'object'],
33
+ pathGroups: [
34
+ {
35
+ pattern: '@alias/**',
36
+ group: 'parent',
37
+ position: 'before',
38
+ },
39
+ ],
40
+ alphabetize: {
41
+ order: 'asc',
42
+ },
43
+ 'newlines-between': 'always',
44
+ },
45
+ ],
46
+
47
+ // sort-class-members
48
+ 'sort-class-members/sort-class-members': [
49
+ 1,
50
+ {
51
+ order: [
52
+ '[static-properties]',
53
+ '[static-methods]',
54
+ '[properties]',
55
+ '[conventional-private-properties]',
56
+ 'constructor',
57
+ '[methods]',
58
+ '[conventional-private-methods]',
59
+ ],
60
+ accessorPairPositioning: 'getThenSet',
61
+ },
62
+ ],
63
+ },
64
+ settings: {
65
+ jsdoc: {
66
+ tagNamePreference: {
67
+ param: 'arg',
68
+ returns: 'return',
69
+ },
70
+ },
71
+ },
72
+ overrides: [
73
+ {
74
+ files: '**/*.spec.*',
75
+ rules: {
76
+ 'import/no-extraneous-dependencies': 0,
77
+ },
78
+ },
79
+ ],
80
+ };
package/index.js CHANGED
@@ -1,151 +1,79 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ const base = require('./base');
3
+
1
4
  /**
2
5
  * @type {import('eslint/lib/shared/types').ConfigData}
3
6
  */
4
7
  module.exports = {
5
- extends: [
6
- 'eslint:recommended',
7
- 'plugin:import/recommended',
8
- 'plugin:import/typescript',
9
- ],
10
- env: {
11
- browser: true,
12
- es6: true,
13
- node: true,
14
- },
15
- plugins: [
16
- '@typescript-eslint',
17
- 'jsdoc',
18
- 'eslint-comments',
19
- 'import',
20
- 'sort-class-members',
21
- ],
22
- parser: '@typescript-eslint/parser',
23
- parserOptions: {
24
- sourceType: 'module',
25
- project: ['./tsconfig.json'],
26
- },
27
- globals: {
28
- NodeJS: true,
29
- },
30
- rules: {
31
- // Standard
32
- 'no-var': 2,
33
- 'no-unused-vars': 0,
34
- 'no-console': 'warn',
35
- 'no-mixed-spaces-and-tabs': 0,
36
-
37
- // @typescript-eslint
38
- '@typescript-eslint/no-unused-vars': 2,
39
- '@typescript-eslint/no-array-constructor': 2,
40
- '@typescript-eslint/adjacent-overload-signatures': 2,
41
- '@typescript-eslint/no-namespace': [2, { allowDeclarations: true }],
42
- '@typescript-eslint/prefer-namespace-keyword': 2,
43
- '@typescript-eslint/no-var-requires': 2,
44
- '@typescript-eslint/no-unnecessary-type-assertion': 2,
45
- '@typescript-eslint/restrict-plus-operands': 0,
46
- '@typescript-eslint/consistent-type-imports': 1,
47
- '@typescript-eslint/require-await': 2,
48
- '@typescript-eslint/no-floating-promises': 2,
49
- '@typescript-eslint/member-ordering': [
50
- 'warn',
51
- {
52
- default: 'never',
53
- classes: {
54
- memberTypes: [
55
- 'public-static-field',
56
- 'protected-static-field',
57
- 'private-static-field',
58
- 'public-static-method',
59
- 'protected-static-method',
60
- 'public-static-get',
61
- 'protected-static-get',
62
- 'private-static-get',
63
- 'public-instance-field',
64
- 'protected-instance-field',
65
- 'private-instance-field',
66
- 'public-abstract-field',
67
- 'protected-abstract-field',
68
- 'public-constructor',
69
- 'protected-constructor',
70
- 'private-constructor',
71
- ['public-abstract-get', 'public-abstract-set'],
72
- ['protected-abstract-get', 'protected-abstract-set'],
73
- ['public-instance-get', 'public-instance-set'],
74
- ['protected-instance-get', 'protected-instance-set'],
75
- ['private-instance-get', 'private-instance-set'],
76
- 'public-abstract-method',
77
- 'protected-abstract-method',
78
- 'public-instance-method',
79
- 'protected-instance-method',
80
- 'private-instance-method',
81
- 'private-static-method',
82
- ],
83
- order: 'alphabetically',
8
+ ...base,
9
+ overrides: [
10
+ {
11
+ files: '**/*.{ts,tsx}',
12
+ extends: ['plugin:import/typescript', 'plugin:@typescript-eslint/recommended'],
13
+ plugins: ['@typescript-eslint', ...base.plugins],
14
+ parser: '@typescript-eslint/parser',
15
+ parserOptions: {
16
+ sourceType: 'module',
17
+ project: ['./tsconfig.json'],
18
+ },
19
+ settings: {
20
+ ...base.settings,
21
+ 'import/parsers': {
22
+ '@typescript-eslint/parser': ['.ts'],
84
23
  },
85
24
  },
86
- ],
87
-
88
- // import
89
- 'import/no-named-as-default': 0,
90
- 'import/no-unresolved': 0,
91
- 'import/no-extraneous-dependencies': 2,
92
- 'import/order': [
93
- 2,
94
- {
95
- groups: ['type', 'builtin', 'external', 'parent', 'sibling', 'index', 'object'],
96
- pathGroups: [
25
+ rules: {
26
+ ...base.rules,
27
+ // @typescript-eslint
28
+ '@typescript-eslint/no-unused-vars': 2,
29
+ '@typescript-eslint/no-array-constructor': 2,
30
+ '@typescript-eslint/adjacent-overload-signatures': 2,
31
+ '@typescript-eslint/no-namespace': [2, { allowDeclarations: true }],
32
+ '@typescript-eslint/prefer-namespace-keyword': 2,
33
+ '@typescript-eslint/no-var-requires': 2,
34
+ '@typescript-eslint/no-unnecessary-type-assertion': 2,
35
+ '@typescript-eslint/restrict-plus-operands': 0,
36
+ '@typescript-eslint/consistent-type-imports': 1,
37
+ '@typescript-eslint/require-await': 2,
38
+ '@typescript-eslint/no-floating-promises': 2,
39
+ '@typescript-eslint/member-ordering': [
40
+ 'warn',
97
41
  {
98
- pattern: '@alias/**',
99
- group: 'parent',
100
- position: 'before',
42
+ default: 'never',
43
+ classes: {
44
+ memberTypes: [
45
+ 'public-static-field',
46
+ 'protected-static-field',
47
+ 'private-static-field',
48
+ 'public-static-method',
49
+ 'protected-static-method',
50
+ 'public-static-get',
51
+ 'protected-static-get',
52
+ 'private-static-get',
53
+ 'public-instance-field',
54
+ 'protected-instance-field',
55
+ 'private-instance-field',
56
+ 'public-abstract-field',
57
+ 'protected-abstract-field',
58
+ 'public-constructor',
59
+ 'protected-constructor',
60
+ 'private-constructor',
61
+ ['public-abstract-get', 'public-abstract-set'],
62
+ ['protected-abstract-get', 'protected-abstract-set'],
63
+ ['public-instance-get', 'public-instance-set'],
64
+ ['protected-instance-get', 'protected-instance-set'],
65
+ ['private-instance-get', 'private-instance-set'],
66
+ 'public-abstract-method',
67
+ 'protected-abstract-method',
68
+ 'public-instance-method',
69
+ 'protected-instance-method',
70
+ 'private-instance-method',
71
+ 'private-static-method',
72
+ ],
73
+ order: 'alphabetically',
74
+ },
101
75
  },
102
76
  ],
103
- alphabetize: {
104
- order: 'asc',
105
- },
106
- 'newlines-between': 'always',
107
- },
108
- ],
109
-
110
- // sort-class-members
111
- 'sort-class-members/sort-class-members': [
112
- 1,
113
- {
114
- order: [
115
- '[static-properties]',
116
- '[static-methods]',
117
- '[properties]',
118
- '[conventional-private-properties]',
119
- 'constructor',
120
- '[methods]',
121
- '[conventional-private-methods]',
122
- ],
123
- accessorPairPositioning: 'getThenSet',
124
- },
125
- ],
126
- },
127
- settings: {
128
- jsdoc: {
129
- tagNamePreference: {
130
- param: 'arg',
131
- returns: 'return',
132
- },
133
- },
134
- 'import/parsers': {
135
- '@typescript-eslint/parser': ['.ts'],
136
- },
137
- },
138
- overrides: [
139
- {
140
- files: '**/*.cjs',
141
- rules: {
142
- '@typescript-eslint/no-var-requires': 0,
143
- },
144
- },
145
- {
146
- files: '**/*.spec.*',
147
- rules: {
148
- 'import/no-extraneous-dependencies': 0,
149
77
  },
150
78
  },
151
79
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-zero/eslint-config",
3
- "version": "5.0.0-dev.73+1b2de1c",
3
+ "version": "5.0.0-dev.84+0b6456e",
4
4
  "description": "Configurations of ESLint",
5
5
  "repository": "https://github.com/d-zero-dev/node-dev-env.git",
6
6
  "author": "D-ZERO Co., Ltd.",
@@ -10,24 +10,33 @@
10
10
  "access": "public"
11
11
  },
12
12
  "files": [
13
- "index.js"
13
+ "index.js",
14
+ "base.js"
14
15
  ],
15
16
  "type": "commonjs",
16
17
  "main": "index.js",
18
+ "exports": {
19
+ ".": {
20
+ "require": "./index.js"
21
+ },
22
+ "./base": {
23
+ "require": "./base.js"
24
+ }
25
+ },
17
26
  "dependencies": {
18
- "@typescript-eslint/eslint-plugin": "6.7.2",
19
- "@typescript-eslint/parser": "6.7.2",
20
- "eslint": "8.49.0",
27
+ "@typescript-eslint/eslint-plugin": "6.15.0",
28
+ "@typescript-eslint/parser": "6.15.0",
29
+ "eslint": "8.56.0",
21
30
  "eslint-plugin-eslint-comments": "3.2.0",
22
- "eslint-plugin-import": "2.28.1",
23
- "eslint-plugin-jsdoc": "46.8.2",
24
- "eslint-plugin-sort-class-members": "1.18.0"
31
+ "eslint-plugin-import": "2.29.1",
32
+ "eslint-plugin-jsdoc": "46.9.1",
33
+ "eslint-plugin-sort-class-members": "1.19.0"
25
34
  },
26
35
  "peerDependencies": {
27
36
  "@d-zero/tsconfig": ">= 5"
28
37
  },
29
38
  "devDependencies": {
30
- "@d-zero/tsconfig": "5.0.0-dev.73+1b2de1c"
39
+ "@d-zero/tsconfig": "5.0.0-dev.84+0b6456e"
31
40
  },
32
- "gitHead": "1b2de1c79685b309de78778be8e0884eed9e3728"
41
+ "gitHead": "0b6456e45825f1d14cf03ae71dd66772cbf22a12"
33
42
  }