@sequencemedia/eslint-config-standard 0.1.7 → 0.2.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/README.md CHANGED
@@ -1,3 +1,62 @@
1
1
  # `@sequencemedia/eslint-config-standard`
2
2
 
3
- [Standard](https://github.com/standard/eslint-config-standard) via [neostandard](https://github.com/neostandard/neostandard)
3
+ Standard style Flat Config for ESLint `v9`
4
+
5
+ Based on [Standard](https://github.com/standard/eslint-config-standard) via [neostandard](https://github.com/neostandard/neostandard)
6
+
7
+ ## Install
8
+
9
+ ```shell
10
+ npm i -D @sequencemedia/eslint-config-standard
11
+ ```
12
+
13
+ ## Use
14
+
15
+ In your `eslint.config.*` either:
16
+
17
+ ```javascript
18
+ export { default } from '@sequencemedia/eslint-config-standard'
19
+ ```
20
+
21
+ Or:
22
+
23
+ ```javascript
24
+ import { configs } from '@sequencemedia/eslint-config-standard'
25
+
26
+ export default [
27
+ configs.recommended
28
+ ]
29
+ ```
30
+
31
+ You can merge _changes_ in the default configuration using the `merge` utility:
32
+
33
+ ```javascript
34
+ import merge from '@sequencemedia/eslint-config-standard/merge'
35
+
36
+ export default merge({
37
+ files: [
38
+ '**/*.{mjs,cjs}'
39
+ ],
40
+ ignores: [
41
+ 'lib'
42
+ ]
43
+ })
44
+ ```
45
+
46
+ Which is _equivalent to_:
47
+
48
+ ```javascript
49
+ import { configs } from '@sequencemedia/eslint-config-standard'
50
+
51
+ export default [
52
+ {
53
+ ...configs.recommended,
54
+ files: [
55
+ '**/*.{mjs,cjs}'
56
+ ],
57
+ ignores: [
58
+ 'lib'
59
+ ]
60
+ }
61
+ ]
62
+ ```
@@ -0,0 +1,20 @@
1
+ import recommended from './recommended.mjs'
2
+ import standard from './standard.mjs'
3
+ import stylistic from './stylistic.mjs'
4
+
5
+ /*
6
+ export { default as recommended } from './recommended.mjs'
7
+ export { default as standard } from './standard.mjs'
8
+ export { default as stylistic } from './stylistic.mjs' */
9
+
10
+ export {
11
+ recommended,
12
+ standard,
13
+ stylistic
14
+ }
15
+
16
+ export default {
17
+ recommended,
18
+ standard,
19
+ stylistic
20
+ }
@@ -6,6 +6,9 @@ export default {
6
6
  languageOptions: {
7
7
  ecmaVersion: 'latest'
8
8
  },
9
+ files: [
10
+ '**/*.{js,mjs,cjs}'
11
+ ],
9
12
  plugins: {
10
13
  ...standard.plugins,
11
14
  ...stylistic.plugins
@@ -14,23 +14,57 @@ export default {
14
14
  * Standard
15
15
  */
16
16
  'no-var': 'warn',
17
- 'object-shorthand': ['warn', 'properties'],
18
- 'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }],
19
- 'array-callback-return': ['error', {
20
- allowImplicit: false,
21
- checkForEach: false
22
- }],
23
- camelcase: ['error', {
24
- allow: ['^UNSAFE_'],
25
- properties: 'never',
26
- ignoreGlobals: true
27
- }],
17
+ 'object-shorthand': [
18
+ 'warn',
19
+ 'properties'
20
+ ],
21
+ 'accessor-pairs': [
22
+ 'error',
23
+ {
24
+ setWithoutGet: true,
25
+ enforceForClassMembers: true
26
+ }
27
+ ],
28
+ 'array-callback-return': [
29
+ 'error',
30
+ {
31
+ allowImplicit: false,
32
+ checkForEach: false
33
+ }
34
+ ],
35
+ camelcase: [
36
+ 'error',
37
+ {
38
+ allow: [
39
+ '^UNSAFE_'
40
+ ],
41
+ properties: 'never',
42
+ ignoreGlobals: true
43
+ }
44
+ ],
28
45
  'constructor-super': 'error',
29
- curly: ['error', 'multi-line'],
46
+ curly: [
47
+ 'error',
48
+ 'multi-line'
49
+ ],
30
50
  'default-case-last': 'error',
31
- 'dot-notation': ['error', { allowKeywords: true }],
32
- eqeqeq: ['error', 'always', { null: 'ignore' }],
33
- 'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }],
51
+ 'dot-notation': [
52
+ 'error',
53
+ { allowKeywords: true }
54
+ ],
55
+ eqeqeq: [
56
+ 'error',
57
+ 'always',
58
+ { null: 'ignore' }
59
+ ],
60
+ 'new-cap': [
61
+ 'error',
62
+ {
63
+ newIsCap: true,
64
+ capIsNew: false,
65
+ properties: true
66
+ }
67
+ ],
34
68
  'no-array-constructor': 'error',
35
69
  'no-async-promise-executor': 'error',
36
70
  'no-caller': 'error',
@@ -39,7 +73,12 @@ export default {
39
73
  'no-compare-neg-zero': 'error',
40
74
  'no-cond-assign': 'error',
41
75
  'no-const-assign': 'error',
42
- 'no-constant-condition': ['error', { checkLoops: false }],
76
+ 'no-constant-condition': [
77
+ 'error',
78
+ {
79
+ checkLoops: false
80
+ }
81
+ ],
43
82
  'no-control-regex': 'error',
44
83
  'no-debugger': 'error',
45
84
  'no-delete-var': 'error',
@@ -48,7 +87,12 @@ export default {
48
87
  'no-dupe-keys': 'error',
49
88
  'no-duplicate-case': 'error',
50
89
  'no-useless-backreference': 'error',
51
- 'no-empty': ['error', { allowEmptyCatch: true }],
90
+ 'no-empty': [
91
+ 'error',
92
+ {
93
+ allowEmptyCatch: true
94
+ }
95
+ ],
52
96
  'no-empty-character-class': 'error',
53
97
  'no-empty-pattern': 'error',
54
98
  'no-eval': 'error',
@@ -64,7 +108,13 @@ export default {
64
108
  'no-invalid-regexp': 'error',
65
109
  'no-irregular-whitespace': 'error',
66
110
  'no-iterator': 'error',
67
- 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
111
+ 'no-labels': [
112
+ 'error',
113
+ {
114
+ allowLoop: false,
115
+ allowSwitch: false
116
+ }
117
+ ],
68
118
  'no-lone-blocks': 'error',
69
119
  'no-loss-of-precision': 'error',
70
120
  'no-misleading-character-class': 'error',
@@ -80,10 +130,23 @@ export default {
80
130
  'no-octal': 'error',
81
131
  'no-octal-escape': 'error',
82
132
  'no-proto': 'error',
83
- 'no-redeclare': ['error', { builtinGlobals: false }],
133
+ 'no-redeclare': [
134
+ 'error',
135
+ {
136
+ builtinGlobals: false
137
+ }
138
+ ],
84
139
  'no-regex-spaces': 'error',
85
- 'no-return-assign': ['error', 'except-parens'],
86
- 'no-self-assign': ['error', { props: true }],
140
+ 'no-return-assign': [
141
+ 'error',
142
+ 'except-parens'
143
+ ],
144
+ 'no-self-assign': [
145
+ 'error',
146
+ {
147
+ props: true
148
+ }
149
+ ],
87
150
  'no-self-compare': 'error',
88
151
  'no-sequences': 'error',
89
152
  'no-shadow-restricted-names': 'error',
@@ -95,23 +158,41 @@ export default {
95
158
  'no-undef-init': 'error',
96
159
  'no-unexpected-multiline': 'error',
97
160
  'no-unmodified-loop-condition': 'error',
98
- 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
161
+ 'no-unneeded-ternary': [
162
+ 'error',
163
+ {
164
+ defaultAssignment: false
165
+ }
166
+ ],
99
167
  'no-unreachable': 'error',
100
168
  'no-unreachable-loop': 'error',
101
169
  'no-unsafe-finally': 'error',
102
170
  'no-unsafe-negation': 'error',
103
- 'no-unused-expressions': ['error', {
104
- allowShortCircuit: true,
105
- allowTernary: true,
106
- allowTaggedTemplates: true
107
- }],
108
- 'no-unused-vars': ['error', {
109
- args: 'none',
110
- caughtErrors: 'none',
111
- ignoreRestSiblings: true,
112
- vars: 'all'
113
- }],
114
- 'no-use-before-define': ['error', { functions: false, classes: false, variables: false }],
171
+ 'no-unused-expressions': [
172
+ 'error',
173
+ {
174
+ allowShortCircuit: true,
175
+ allowTernary: true,
176
+ allowTaggedTemplates: true
177
+ }
178
+ ],
179
+ 'no-unused-vars': [
180
+ 'error',
181
+ {
182
+ args: 'none',
183
+ caughtErrors: 'none',
184
+ ignoreRestSiblings: true,
185
+ vars: 'all'
186
+ }
187
+ ],
188
+ 'no-use-before-define': [
189
+ 'error',
190
+ {
191
+ functions: false,
192
+ classes: false,
193
+ variables: false
194
+ }
195
+ ],
115
196
  'no-useless-call': 'error',
116
197
  'no-useless-computed-key': 'error',
117
198
  'no-useless-constructor': 'error',
@@ -120,23 +201,55 @@ export default {
120
201
  'no-useless-return': 'error',
121
202
  'no-void': 'error',
122
203
  'no-with': 'error',
123
- 'one-var': ['error', { initialized: 'never' }],
124
- 'prefer-const': ['error', { destructuring: 'all' }],
204
+ 'one-var': [
205
+ 'error',
206
+ {
207
+ initialized: 'never'
208
+ }
209
+ ],
210
+ 'prefer-const': [
211
+ 'error',
212
+ {
213
+ destructuring: 'all'
214
+ }
215
+ ],
125
216
  'prefer-promise-reject-errors': 'error',
126
- 'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }],
217
+ 'prefer-regex-literals': [
218
+ 'error',
219
+ {
220
+ disallowRedundantWrapping: true
221
+ }
222
+ ],
127
223
  'symbol-description': 'error',
128
- 'unicode-bom': ['error', 'never'],
129
- 'use-isnan': ['error', {
130
- enforceForSwitchCase: true,
131
- enforceForIndexOf: true
132
- }],
133
- 'valid-typeof': ['error', { requireStringLiterals: true }],
134
- yoda: ['error', 'never'],
224
+ 'unicode-bom': [
225
+ 'error',
226
+ 'never'
227
+ ],
228
+ 'use-isnan': [
229
+ 'error',
230
+ {
231
+ enforceForSwitchCase: true,
232
+ enforceForIndexOf: true
233
+ }
234
+ ],
235
+ 'valid-typeof': [
236
+ 'error',
237
+ {
238
+ requireStringLiterals: true
239
+ }
240
+ ],
241
+ yoda: [
242
+ 'error',
243
+ 'never'
244
+ ],
135
245
 
136
246
  /**
137
247
  * `eslint-plugin-n`
138
248
  */
139
- 'n/handle-callback-err': ['error', '^(err|error)$'],
249
+ 'n/handle-callback-err': [
250
+ 'error',
251
+ '^(err|error)$'
252
+ ],
140
253
  'n/no-callback-literal': 'error',
141
254
  'n/no-deprecated-api': 'error',
142
255
  'n/no-exports-assign': 'error',
@@ -154,7 +267,14 @@ export default {
154
267
  */
155
268
  'import/export': 'error',
156
269
  'import/first': 'error',
157
- 'import/no-absolute-path': ['error', { esmodule: true, commonjs: true, amd: false }],
270
+ 'import/no-absolute-path': [
271
+ 'error',
272
+ {
273
+ esmodule: true,
274
+ commonjs: true,
275
+ amd: false
276
+ }
277
+ ],
158
278
  'import/no-duplicates': 'error',
159
279
  'import/no-named-default': 'error',
160
280
  'import/no-webpack-loader-syntax': 'error'
@@ -0,0 +1,327 @@
1
+ import stylistic from '@stylistic/eslint-plugin'
2
+
3
+ export default {
4
+ name: '@sequencemedia/eslint-config-standard/stylistic',
5
+ plugins: {
6
+ '@stylistic': stylistic
7
+
8
+ },
9
+ rules: {
10
+ /**
11
+ * `@stylistic/eslint-plugin`
12
+ */
13
+ '@stylistic/array-bracket-spacing': [
14
+ 'error',
15
+ 'never'
16
+ ],
17
+ '@stylistic/arrow-spacing': [
18
+ 'error',
19
+ {
20
+ before: true,
21
+ after: true
22
+ }
23
+ ],
24
+ '@stylistic/block-spacing': [
25
+ 'error',
26
+ 'always'
27
+ ],
28
+ '@stylistic/brace-style': [
29
+ 'error',
30
+ '1tbs',
31
+ {
32
+ allowSingleLine: true
33
+ }
34
+ ],
35
+ '@stylistic/comma-dangle': [
36
+ 'error',
37
+ {
38
+ arrays: 'never',
39
+ objects: 'never',
40
+ imports: 'never',
41
+ exports: 'never',
42
+ functions: 'never'
43
+ }
44
+ ],
45
+ '@stylistic/comma-spacing': [
46
+ 'error',
47
+ {
48
+ before: false,
49
+ after: true
50
+ }
51
+ ],
52
+ '@stylistic/comma-style': [
53
+ 'error',
54
+ 'last'
55
+ ],
56
+ '@stylistic/computed-property-spacing': [
57
+ 'error',
58
+ 'never',
59
+ {
60
+ enforceForClassMembers: true
61
+ }
62
+ ],
63
+ '@stylistic/dot-location': [
64
+ 'error',
65
+ 'property'
66
+ ],
67
+ '@stylistic/eol-last': 'error',
68
+ '@stylistic/func-call-spacing': [
69
+ 'error',
70
+ 'never'
71
+ ],
72
+ '@stylistic/generator-star-spacing': [
73
+ 'error',
74
+ {
75
+ before: true,
76
+ after: true
77
+ }
78
+ ],
79
+ '@stylistic/indent': [
80
+ 'error',
81
+ 2,
82
+ {
83
+ SwitchCase: 1,
84
+ VariableDeclarator: 1,
85
+ outerIIFEBody: 1,
86
+ MemberExpression: 1,
87
+ FunctionDeclaration: {
88
+ parameters: 1,
89
+ body: 1
90
+ },
91
+ FunctionExpression: {
92
+ parameters: 1,
93
+ body: 1
94
+ },
95
+ CallExpression: {
96
+ arguments: 1
97
+ },
98
+ ArrayExpression: 1,
99
+ ObjectExpression: 1,
100
+ ImportDeclaration: 1,
101
+ flatTernaryExpressions: false,
102
+ ignoreComments: false,
103
+ ignoredNodes: [
104
+ 'TemplateLiteral *',
105
+ 'JSXElement',
106
+ 'JSXElement > *',
107
+ 'JSXAttribute',
108
+ 'JSXIdentifier',
109
+ 'JSXNamespacedName',
110
+ 'JSXMemberExpression',
111
+ 'JSXSpreadAttribute',
112
+ 'JSXExpressionContainer',
113
+ 'JSXOpeningElement',
114
+ 'JSXClosingElement',
115
+ 'JSXFragment',
116
+ 'JSXOpeningFragment',
117
+ 'JSXClosingFragment',
118
+ 'JSXText',
119
+ 'JSXEmptyExpression',
120
+ 'JSXSpreadChild'
121
+ ],
122
+ offsetTernaryExpressions: true
123
+ }
124
+ ],
125
+ '@stylistic/key-spacing': [
126
+ 'error',
127
+ {
128
+ beforeColon: false,
129
+ afterColon: true
130
+ }
131
+ ],
132
+ '@stylistic/keyword-spacing': [
133
+ 'error',
134
+ {
135
+ before: true,
136
+ after: true
137
+ }
138
+ ],
139
+ '@stylistic/lines-between-class-members': [
140
+ 'error',
141
+ 'always',
142
+ {
143
+ exceptAfterSingleLine: true
144
+ }
145
+ ],
146
+ '@stylistic/multiline-ternary': [
147
+ 'error',
148
+ 'always-multiline'
149
+ ],
150
+ '@stylistic/new-parens': 'error',
151
+ '@stylistic/no-extra-parens': [
152
+ 'error',
153
+ 'functions'
154
+ ],
155
+ '@stylistic/no-floating-decimal': 'error',
156
+ '@stylistic/no-mixed-operators': [
157
+ 'error',
158
+ {
159
+ groups: [
160
+ [
161
+ '==',
162
+ '!=',
163
+ '===',
164
+ '!==',
165
+ '>',
166
+ '>=',
167
+ '<',
168
+ '<='
169
+ ],
170
+ [
171
+ '&&',
172
+ '||'
173
+ ],
174
+ [
175
+ 'in',
176
+ 'instanceof'
177
+ ]
178
+ ],
179
+ allowSamePrecedence: true
180
+ }
181
+ ],
182
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
183
+ '@stylistic/no-multi-spaces': 'error',
184
+ '@stylistic/no-multiple-empty-lines': [
185
+ 'error',
186
+ {
187
+ max: 1,
188
+ maxBOF: 0,
189
+ maxEOF: 0
190
+ }
191
+ ],
192
+ '@stylistic/no-tabs': 'error',
193
+ '@stylistic/no-trailing-spaces': 'error',
194
+ '@stylistic/no-whitespace-before-property': 'error',
195
+ '@stylistic/object-curly-newline': [
196
+ 'error',
197
+ {
198
+ multiline: true,
199
+ consistent: true
200
+ }
201
+ ],
202
+ '@stylistic/object-curly-spacing': [
203
+ 'error',
204
+ 'always'
205
+ ],
206
+ '@stylistic/object-property-newline': [
207
+ 'error',
208
+ {
209
+ allowMultiplePropertiesPerLine: true
210
+ }
211
+ ],
212
+ '@stylistic/operator-linebreak': [
213
+ 'error',
214
+ 'after',
215
+ {
216
+ overrides: {
217
+ '?': 'before',
218
+ ':': 'before',
219
+ '|>': 'before'
220
+ }
221
+ }
222
+ ],
223
+ '@stylistic/padded-blocks': [
224
+ 'error',
225
+ {
226
+ blocks: 'never',
227
+ switches: 'never',
228
+ classes: 'never'
229
+ }
230
+ ],
231
+ '@stylistic/quote-props': [
232
+ 'error',
233
+ 'as-needed'
234
+ ],
235
+ '@stylistic/quotes': [
236
+ 'error',
237
+ 'single',
238
+ {
239
+ avoidEscape: true,
240
+ allowTemplateLiterals: false
241
+ }
242
+ ],
243
+ '@stylistic/rest-spread-spacing': [
244
+ 'error',
245
+ 'never'
246
+ ],
247
+ '@stylistic/semi': [
248
+ 'error',
249
+ 'never'
250
+ ],
251
+ '@stylistic/semi-spacing': [
252
+ 'error',
253
+ {
254
+ before: false,
255
+ after: true
256
+ }
257
+ ],
258
+ '@stylistic/space-before-blocks': [
259
+ 'error',
260
+ 'always'
261
+ ],
262
+ '@stylistic/space-before-function-paren': [
263
+ 'error',
264
+ 'always'
265
+ ],
266
+ '@stylistic/space-in-parens': [
267
+ 'error',
268
+ 'never'
269
+ ],
270
+ '@stylistic/space-infix-ops': 'error',
271
+ '@stylistic/space-unary-ops': [
272
+ 'error',
273
+ {
274
+ words: true,
275
+ nonwords: false
276
+ }
277
+ ],
278
+ '@stylistic/spaced-comment': [
279
+ 'error',
280
+ 'always',
281
+ {
282
+ line: {
283
+ markers: [
284
+ '*package',
285
+ '!',
286
+ '/',
287
+ ',',
288
+ '='
289
+ ]
290
+ },
291
+ block: {
292
+ balanced: true,
293
+ markers: [
294
+ '*package',
295
+ '!',
296
+ ',',
297
+ ':',
298
+ '::',
299
+ 'flow-include'
300
+ ],
301
+ exceptions: [
302
+ '*'
303
+ ]
304
+ }
305
+ }
306
+ ],
307
+ '@stylistic/template-curly-spacing': [
308
+ 'error',
309
+ 'never'
310
+ ],
311
+ '@stylistic/template-tag-spacing': [
312
+ 'error',
313
+ 'never'
314
+ ],
315
+ '@stylistic/wrap-iife': [
316
+ 'error',
317
+ 'any',
318
+ {
319
+ functionPrototypeMethods: true
320
+ }
321
+ ],
322
+ '@stylistic/yield-star-spacing': [
323
+ 'error',
324
+ 'both'
325
+ ]
326
+ }
327
+ }
package/index.mjs CHANGED
@@ -1,12 +1,22 @@
1
- import standard from '#eslint-config-standard/config/standard'
2
- import stylistic from '#eslint-config-standard/config/stylistic'
1
+ import recommended from './configs/recommended.mjs'
2
+ import standard from './configs/standard.mjs'
3
+ import stylistic from './configs/stylistic.mjs'
4
+
5
+ export const configs = {
6
+ recommended,
7
+ standard,
8
+ stylistic
9
+ }
3
10
 
4
11
  export default [
5
12
  {
6
13
  name: '@sequencemedia/eslint-config-standard',
7
14
  languageOptions: {
8
15
  ecmaVersion: 'latest'
9
- }
16
+ },
17
+ files: [
18
+ '**/*.{js,mjs,cjs}'
19
+ ]
10
20
  },
11
21
  standard,
12
22
  stylistic
@@ -0,0 +1,12 @@
1
+ import merge from '@sequencemedia/eslint-merge'
2
+
3
+ import CONFIG from '#eslint-config-standard/configs/recommended'
4
+
5
+ export default function mergeConfig (config) {
6
+ return (
7
+ merge(
8
+ CONFIG,
9
+ config
10
+ )
11
+ )
12
+ }
@@ -1,6 +1,6 @@
1
1
  import merge from '@sequencemedia/eslint-merge'
2
2
 
3
- import CONFIG from '#eslint-config-standard/config/standard'
3
+ import CONFIG from '#eslint-config-standard/configs/standard'
4
4
 
5
5
  export default function mergeConfig (config) {
6
6
  return (
@@ -1,6 +1,6 @@
1
1
  import merge from '@sequencemedia/eslint-merge'
2
2
 
3
- import CONFIG from '#eslint-config-standard/config/stylistic'
3
+ import CONFIG from '#eslint-config-standard/configs/stylistic'
4
4
 
5
5
  export default function mergeConfig (config) {
6
6
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequencemedia/eslint-config-standard",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "description": "Standard configuration for ESLint 9",
5
5
  "keywords": [
6
6
  "JavaScript Standard Style",
@@ -70,16 +70,15 @@
70
70
  "imports": {
71
71
  "#eslint-config-standard": "./index.mjs",
72
72
  "#eslint-config-standard/common": "./common/index.mjs",
73
- "#eslint-config-standard/config": "./config/index.mjs",
74
- "#eslint-config-standard/config/*": "./config/*.mjs",
73
+ "#eslint-config-standard/configs": "./configs/index.mjs",
74
+ "#eslint-config-standard/configs/*": "./configs/*.mjs",
75
75
  "#eslint-config-standard/merge": "./merge.mjs",
76
76
  "#eslint-config-standard/merge/*": "./merge/*.mjs"
77
77
  },
78
78
  "exports": {
79
79
  ".": "./index.mjs",
80
- "./common": "./common/index.mjs",
81
- "./config": "./config/index.mjs",
82
- "./config/*": "./config/*.mjs",
80
+ "./configs": "./configs/index.mjs",
81
+ "./configs/*": "./configs/*.mjs",
83
82
  "./merge": "./merge.mjs",
84
83
  "./merge/*": "./merge/*.mjs"
85
84
  }
@@ -5,9 +5,9 @@ import {
5
5
  import {
6
6
  isString,
7
7
  isObject
8
- } from '@sequencemedia/eslint-config-standard/common'
8
+ } from '#eslint-config-standard/common'
9
9
 
10
- describe('@sequencemedia/eslint-config-standard/common', () => {
10
+ describe('#eslint-config-standard/common', () => {
11
11
  describe('`isString`', () => it('is a function', () => expect(isString).to.be.a('function')))
12
12
 
13
13
  describe('`isObject`', () => it('is a function', () => expect(isObject).to.be.a('function')))
@@ -6,9 +6,9 @@ import {
6
6
  recommended,
7
7
  standard,
8
8
  stylistic
9
- } from '@sequencemedia/eslint-config-standard/config'
9
+ } from '@sequencemedia/eslint-config-standard/configs'
10
10
 
11
- describe('@sequencemedia/eslint-config-standard/config', () => {
11
+ describe('@sequencemedia/eslint-config-standard/configs', () => {
12
12
  describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
13
13
 
14
14
  describe('`standard`', () => it('is an object', () => expect(standard).to.be.an('object')))
@@ -2,8 +2,8 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import recommended from '@sequencemedia/eslint-config-standard/config/recommended'
5
+ import recommended from '@sequencemedia/eslint-config-standard/configs/recommended'
6
6
 
7
- describe('@sequencemedia/eslint-config-standard/config/recommended', () => {
7
+ describe('@sequencemedia/eslint-config-standard/configs/recommended', () => {
8
8
  describe('`recommended`', () => it('is an object', () => expect(recommended).to.be.an('object')))
9
9
  })
@@ -2,8 +2,8 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import standard from '@sequencemedia/eslint-config-standard/config/standard'
5
+ import standard from '@sequencemedia/eslint-config-standard/configs/standard'
6
6
 
7
- describe('@sequencemedia/eslint-config-standard/config/standard', () => {
7
+ describe('@sequencemedia/eslint-config-standard/configs/standard', () => {
8
8
  describe('`standard`', () => it('is an object', () => expect(standard).to.be.an('object')))
9
9
  })
@@ -2,8 +2,8 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import stylistic from '@sequencemedia/eslint-config-standard/config/stylistic'
5
+ import stylistic from '@sequencemedia/eslint-config-standard/configs/stylistic'
6
6
 
7
- describe('@sequencemedia/eslint-config-standard/config/stylistic', () => {
7
+ describe('@sequencemedia/eslint-config-standard/configs/stylistic', () => {
8
8
  describe('`stylistic`', () => it('is an object', () => expect(stylistic).to.be.an('object')))
9
9
  })
@@ -0,0 +1,63 @@
1
+ import {
2
+ expect
3
+ } from 'chai'
4
+
5
+ import RECOMMENDED from '@sequencemedia/eslint-config-standard/configs/recommended'
6
+
7
+ import merge from '@sequencemedia/eslint-config-standard/merge/recommended'
8
+
9
+ describe('@sequencemedia/eslint-config-standard/merge/recommended', () => {
10
+ describe('`merge`', () => it('is a function', () => expect(merge).to.be.a('function')))
11
+
12
+ describe('`merge()`', () => {
13
+ describe('Always', () => it('returns an object', () => expect(merge()).to.be.an('object')))
14
+
15
+ describe('Merges', () => {
16
+ it('returns an object', () => {
17
+ const MOCK_FILES = [
18
+ 'MOCK FILES'
19
+ ]
20
+ const MOCK_IGNORES = [
21
+ 'MOCK IGNORES'
22
+ ]
23
+ const MOCK_LANGUAGE_OPTIONS = { mockOption: 'MOCK LANGUAGE OPTIONS' }
24
+ const MOCK_LINTER_OPTIONS = { mockOption: 'MOCK LINTER OPTIONS' }
25
+ const MOCK_RULES = { mockOption: 'MOCK RULES' }
26
+ const MOCK_SETTINGS = { mockOption: 'MOCK SETTINGS' }
27
+
28
+ const {
29
+ languageOptions: RECOMMENDED_LANGUAGE_OPTIONS,
30
+ rules: RECOMMENDED_RULES
31
+ } = RECOMMENDED
32
+
33
+ return (
34
+ expect(
35
+ merge({
36
+ files: MOCK_FILES,
37
+ ignores: MOCK_IGNORES,
38
+ languageOptions: MOCK_LANGUAGE_OPTIONS,
39
+ linterOptions: MOCK_LINTER_OPTIONS,
40
+ rules: MOCK_RULES,
41
+ settings: MOCK_SETTINGS
42
+ })
43
+ )
44
+ .to.eql({
45
+ ...RECOMMENDED,
46
+ files: MOCK_FILES,
47
+ ignores: MOCK_IGNORES,
48
+ languageOptions: {
49
+ ...RECOMMENDED_LANGUAGE_OPTIONS,
50
+ ...MOCK_LANGUAGE_OPTIONS
51
+ },
52
+ linterOptions: MOCK_LINTER_OPTIONS,
53
+ rules: {
54
+ ...RECOMMENDED_RULES,
55
+ ...MOCK_RULES
56
+ },
57
+ settings: MOCK_SETTINGS
58
+ })
59
+ )
60
+ })
61
+ })
62
+ })
63
+ })
@@ -2,7 +2,7 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import STANDARD from '@sequencemedia/eslint-config-standard/config/standard'
5
+ import STANDARD from '@sequencemedia/eslint-config-standard/configs/standard'
6
6
 
7
7
  import merge from '@sequencemedia/eslint-config-standard/merge/standard'
8
8
 
@@ -2,7 +2,7 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import STYLISTIC from '@sequencemedia/eslint-config-standard/config/stylistic'
5
+ import STYLISTIC from '@sequencemedia/eslint-config-standard/configs/stylistic'
6
6
 
7
7
  import merge from '@sequencemedia/eslint-config-standard/merge/stylistic'
8
8
 
@@ -2,8 +2,8 @@ import {
2
2
  expect
3
3
  } from 'chai'
4
4
 
5
- import STANDARD from '@sequencemedia/eslint-config-standard/config/standard'
6
- import STYLISTIC from '@sequencemedia/eslint-config-standard/config/stylistic'
5
+ import STANDARD from '@sequencemedia/eslint-config-standard/configs/standard'
6
+ import STYLISTIC from '@sequencemedia/eslint-config-standard/configs/stylistic'
7
7
 
8
8
  import merge from '@sequencemedia/eslint-config-standard/merge'
9
9
 
@@ -21,10 +21,18 @@ describe('@sequencemedia/eslint-config-standard/merge', () => {
21
21
  const MOCK_IGNORES = [
22
22
  'MOCK IGNORES'
23
23
  ]
24
- const MOCK_LANGUAGE_OPTIONS = { mockOption: 'MOCK LANGUAGE OPTIONS' }
25
- const MOCK_LINTER_OPTIONS = { mockOption: 'MOCK LINTER OPTIONS' }
26
- const MOCK_RULES = { mockOption: 'MOCK RULES' }
27
- const MOCK_SETTINGS = { mockOption: 'MOCK SETTINGS' }
24
+ const MOCK_LANGUAGE_OPTIONS = {
25
+ mockOption: 'MOCK LANGUAGE OPTIONS'
26
+ }
27
+ const MOCK_LINTER_OPTIONS = {
28
+ mockOption: 'MOCK LINTER OPTIONS'
29
+ }
30
+ const MOCK_RULES = {
31
+ mockOption: 'MOCK RULES'
32
+ }
33
+ const MOCK_SETTINGS = {
34
+ mockOption: 'MOCK SETTINGS'
35
+ }
28
36
 
29
37
  const {
30
38
  rules: STANDARD_RULES
@@ -50,7 +58,10 @@ describe('@sequencemedia/eslint-config-standard/merge', () => {
50
58
  name: '@sequencemedia/eslint-config-standard',
51
59
  languageOptions: {
52
60
  ecmaVersion: 'latest'
53
- }
61
+ },
62
+ files: [
63
+ '**/*.{js,mjs,cjs}'
64
+ ]
54
65
  },
55
66
  {
56
67
  ...STANDARD,
package/config/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- export { default as recommended } from './recommended.mjs'
2
- export { default as standard } from './standard.mjs'
3
- export { default as stylistic } from './stylistic.mjs'
@@ -1,91 +0,0 @@
1
- import stylistic from '@stylistic/eslint-plugin'
2
-
3
- export default {
4
- name: '@sequencemedia/eslint-config-standard/stylistic',
5
- plugins: {
6
- '@stylistic': stylistic
7
- },
8
- rules: {
9
- /**
10
- * `@stylistic/eslint-plugin`
11
- */
12
- '@stylistic/array-bracket-spacing': ['error', 'never'],
13
- '@stylistic/arrow-spacing': ['error', { before: true, after: true }],
14
- '@stylistic/block-spacing': ['error', 'always'],
15
- '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: true }],
16
- '@stylistic/comma-dangle': ['error', {
17
- arrays: 'never',
18
- objects: 'never',
19
- imports: 'never',
20
- exports: 'never',
21
- functions: 'never'
22
- }],
23
- '@stylistic/comma-spacing': ['error', { before: false, after: true }],
24
- '@stylistic/comma-style': ['error', 'last'],
25
- '@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
26
- '@stylistic/dot-location': ['error', 'property'],
27
- '@stylistic/eol-last': 'error',
28
- '@stylistic/func-call-spacing': ['error', 'never'],
29
- '@stylistic/generator-star-spacing': ['error', { before: true, after: true }],
30
- '@stylistic/indent': ['error', 2, {
31
- SwitchCase: 1,
32
- VariableDeclarator: 1,
33
- outerIIFEBody: 1,
34
- MemberExpression: 1,
35
- FunctionDeclaration: { parameters: 1, body: 1 },
36
- FunctionExpression: { parameters: 1, body: 1 },
37
- CallExpression: { arguments: 1 },
38
- ArrayExpression: 1,
39
- ObjectExpression: 1,
40
- ImportDeclaration: 1,
41
- flatTernaryExpressions: false,
42
- ignoreComments: false,
43
- ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
44
- offsetTernaryExpressions: true
45
- }],
46
- '@stylistic/key-spacing': ['error', { beforeColon: false, afterColon: true }],
47
- '@stylistic/keyword-spacing': ['error', { before: true, after: true }],
48
- '@stylistic/lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
49
- '@stylistic/multiline-ternary': ['error', 'always-multiline'],
50
- '@stylistic/new-parens': 'error',
51
- '@stylistic/no-extra-parens': ['error', 'functions'],
52
- '@stylistic/no-floating-decimal': 'error',
53
- '@stylistic/no-mixed-operators': ['error', {
54
- groups: [
55
- ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
56
- ['&&', '||'],
57
- ['in', 'instanceof']
58
- ],
59
- allowSamePrecedence: true
60
- }],
61
- '@stylistic/no-mixed-spaces-and-tabs': 'error',
62
- '@stylistic/no-multi-spaces': 'error',
63
- '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
64
- '@stylistic/no-tabs': 'error',
65
- '@stylistic/no-trailing-spaces': 'error',
66
- '@stylistic/no-whitespace-before-property': 'error',
67
- '@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
68
- '@stylistic/object-curly-spacing': ['error', 'always'],
69
- '@stylistic/object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }],
70
- '@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
71
- '@stylistic/padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
72
- '@stylistic/quote-props': ['error', 'as-needed'],
73
- '@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
74
- '@stylistic/rest-spread-spacing': ['error', 'never'],
75
- '@stylistic/semi': ['error', 'never'],
76
- '@stylistic/semi-spacing': ['error', { before: false, after: true }],
77
- '@stylistic/space-before-blocks': ['error', 'always'],
78
- '@stylistic/space-before-function-paren': ['error', 'always'],
79
- '@stylistic/space-in-parens': ['error', 'never'],
80
- '@stylistic/space-infix-ops': 'error',
81
- '@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }],
82
- '@stylistic/spaced-comment': ['error', 'always', {
83
- line: { markers: ['*package', '!', '/', ',', '='] },
84
- block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }
85
- }],
86
- '@stylistic/template-curly-spacing': ['error', 'never'],
87
- '@stylistic/template-tag-spacing': ['error', 'never'],
88
- '@stylistic/wrap-iife': ['error', 'any', { functionPrototypeMethods: true }],
89
- '@stylistic/yield-star-spacing': ['error', 'both']
90
- }
91
- }