@origin-1/eslint-config 0.11.0 → 0.13.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/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # @origin-1/eslint-config · [![npm version][npm badge]][npm url]
2
2
 
3
- [ESLint](https://eslint.org/) configuration generator with [Origin₁](https://github.com/origin-1) presets
3
+ [ESLint](https://eslint.org/) configuration generator with [Origin₁](https://github.com/origin-1) presets.
4
4
 
5
- [npm badge]:
6
- https://badge.fury.io/js/@origin-1%2Feslint-config.svg
7
-
8
- [npm url]:
9
- https://www.npmjs.com/package/@origin-1/eslint-config
5
+ [npm badge]: https://img.shields.io/npm/v/@origin-1%2Feslint-config.svg?logo=npm
6
+ [npm url]: https://www.npmjs.com/package/@origin-1/eslint-config
@@ -5,6 +5,7 @@ export interface ConfigData extends Linter.HasRules {
5
5
  extends?: string | string[] | undefined;
6
6
  globals?: Linter.BaseConfig['globals'];
7
7
  jsVersion?: JSVersion | undefined;
8
+ parser?: string | undefined;
8
9
  parserOptions?: Linter.ParserOptions | undefined;
9
10
  plugins?: string[] | undefined;
10
11
  tsVersion?: TSVersion | undefined;
@@ -33,7 +33,7 @@ function createBaseConfig(configData) {
33
33
  reportUnusedDisableDirectives: true,
34
34
  rules,
35
35
  };
36
- if (lang != null)
36
+ if (parser != null)
37
37
  baseConfig.parser = parser;
38
38
  return baseConfig;
39
39
  }
@@ -43,8 +43,8 @@ function createBaseOverride(configData) {
43
43
  const plugins = configPlugins == null ? [] : [...configPlugins];
44
44
  const lang = getLanguage(configData);
45
45
  let ecmaVersion;
46
+ let { parser } = configData;
46
47
  let envKey;
47
- let parser;
48
48
  const jsVersion = (0, normalize_version_js_1.normalizeJSVersion)(configData.jsVersion);
49
49
  if (jsVersion === 2015)
50
50
  envKey = 'es6';
@@ -54,11 +54,11 @@ function createBaseOverride(configData) {
54
54
  switch (lang) {
55
55
  case 'js':
56
56
  ecmaVersion = jsVersion;
57
- parser = 'espree';
57
+ parser ??= 'espree';
58
58
  break;
59
59
  case 'ts':
60
60
  ecmaVersion = 'latest';
61
- parser = '@typescript-eslint/parser';
61
+ parser ??= '@typescript-eslint/parser';
62
62
  break;
63
63
  default:
64
64
  break;
@@ -68,8 +68,9 @@ function createBaseOverride(configData) {
68
68
  const parserOptions = { ecmaVersion, ...configData.parserOptions };
69
69
  const rules = {};
70
70
  const baseOverride = { env, parserOptions, plugins, rules };
71
- if (lang != null) {
71
+ if (parser != null)
72
72
  baseOverride.parser = parser;
73
+ if (lang != null) {
73
74
  const setOverrideRule = (ruleKey, ruleLangSettings) => {
74
75
  const ruleEntry = isVersionedList(ruleLangSettings) ?
75
76
  findRuleEntry(ruleLangSettings, jsVersion, tsVersion) : ruleLangSettings;
package/lib/rules.js CHANGED
@@ -232,14 +232,6 @@ exports.RULES = {
232
232
  'jsx-quotes': ['error'],
233
233
  'line-comment-position': 'off',
234
234
  'linebreak-style': ['error'],
235
- 'lines-around-comment': jsts([
236
- 'error',
237
- {
238
- allowBlockStart: true,
239
- allowObjectStart: true,
240
- applyDefaultIgnorePatterns: false,
241
- },
242
- ], 'off'),
243
235
  'max-len': ['error', { code: 100 }],
244
236
  'max-statements-per-line': ['error'],
245
237
  'multiline-ternary': 'off',
@@ -263,7 +255,7 @@ exports.RULES = {
263
255
  'space-unary-ops': ['error'],
264
256
  'switch-colon-spacing': ['error', { after: true, before: false }],
265
257
  'template-curly-spacing': ['error'],
266
- 'template-tag-spacing': ['error', 'always'],
258
+ 'template-tag-spacing': 'off',
267
259
  'unicode-bom': ['error'],
268
260
  'wrap-iife': 'off',
269
261
  'wrap-regex': 'off',
@@ -299,6 +291,14 @@ exports.RULES = {
299
291
  'indent': 'off',
300
292
  'key-spacing': 'off',
301
293
  'keyword-spacing': ['error'],
294
+ 'lines-around-comment': [
295
+ 'error',
296
+ {
297
+ allowBlockStart: true,
298
+ allowObjectStart: true,
299
+ applyDefaultIgnorePatterns: false,
300
+ },
301
+ ],
302
302
  'lines-between-class-members': 'off',
303
303
  'no-extra-parens': ['error'],
304
304
  'object-curly-spacing': ['error', 'always'],
@@ -341,6 +341,7 @@ exports.RULES = {
341
341
  'no-invalid-void-type': 'off',
342
342
  'no-misused-new': ['error'],
343
343
  'no-misused-promises': ['error'],
344
+ 'no-mixed-enums': ['error'],
344
345
  'no-non-null-asserted-nullish-coalescing': ['error'],
345
346
  'no-non-null-asserted-optional-chain': ['error'],
346
347
  'no-non-null-assertion': 'off',
@@ -374,6 +375,7 @@ exports.RULES = {
374
375
  'method-signature-style': 'off',
375
376
  'naming-convention': 'off',
376
377
  'no-base-to-string': ['error'],
378
+ 'no-duplicate-type-constituents': ['error'],
377
379
  'no-dynamic-delete': 'off',
378
380
  'no-empty-interface': ['error', { allowSingleExtends: true }],
379
381
  'no-explicit-any': 'off',
@@ -421,6 +423,7 @@ exports.RULES = {
421
423
  'indent': ['error'],
422
424
  'nice-space-before-function-paren': ['error'],
423
425
  'no-spaces-in-call-expression': ['error'],
426
+ 'no-spaces-in-tagged-template': ['error'],
424
427
  'property-colon-spacing': ['error'],
425
428
  },
426
429
  'eslint-plugin-n': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@origin-1/eslint-config",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "ESLint configuration generator with Origin₁ presets",
5
5
  "homepage": "https://github.com/origin-1/eslint-config#readme",
6
6
  "license": "ISC",
@@ -11,10 +11,10 @@
11
11
  "semver": "7"
12
12
  },
13
13
  "peerDependencies": {
14
- "@origin-1/eslint-plugin": ">=0.10",
15
- "@typescript-eslint/eslint-plugin": "^5.52",
16
- "@typescript-eslint/parser": "^5.52",
17
- "eslint": "^8.28",
14
+ "@origin-1/eslint-plugin": ">=0.13",
15
+ "@typescript-eslint/eslint-plugin": "^5.57",
16
+ "@typescript-eslint/parser": "^5.57",
17
+ "eslint": "^8.37",
18
18
  "eslint-plugin-n": "15"
19
19
  },
20
20
  "engines": {