@d-zero/eslint-config 5.0.0-dev.83 → 5.0.0-dev.85

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