@jarsec/eslint-config 4.5.0 → 5.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @jarsec/eslint-config
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - c703d78: Refactor eslint configuration
8
+
9
+ Version 5 brings the following changes:
10
+
11
+ - Removal of xo and xo-typescript
12
+ - Separation of javascript and typescript rules
13
+ - Introduction of @stylistic/eslint-plugin and associated rules (to replace dprint/prettier)
14
+ - Addition of node-specific lint rules
15
+
16
+ ### Patch Changes
17
+
18
+ - 6c2981c: fix(renovate): Update patch dependencies (patch)
19
+ - cc5eb8e: fix(renovate): Update minor (minor)
20
+
3
21
  ## 4.5.0
4
22
 
5
23
  ### Minor Changes
@@ -0,0 +1,140 @@
1
+ module.exports = {
2
+ '@stylistic/array-bracket-newline': ['error', 'consistent'],
3
+ '@stylistic/array-bracket-spacing': ['error', 'never', {
4
+ arraysInArrays: true,
5
+ objectsInArrays: false,
6
+ singleValue: true
7
+ }],
8
+ '@stylistic/array-element-newline': ['error', 'consistent'],
9
+ '@stylistic/arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
10
+ '@stylistic/arrow-spacing': 'error',
11
+ '@stylistic/block-spacing': 'error',
12
+ '@stylistic/brace-style': ['error', '1tbs', {
13
+ allowSingleLine: true
14
+ }],
15
+ '@stylistic/comma-dangle': ['error', 'only-multiline'],
16
+ '@stylistic/comma-spacing': 'error',
17
+ '@stylistic/comma-style': ['error', 'last'],
18
+ '@stylistic/computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }],
19
+ '@stylistic/dot-location': ['error', 'property'],
20
+ '@stylistic/eol-last': ['error', 'always'],
21
+ '@stylistic/function-call-argument-newline': ['error', 'consistent'],
22
+ '@stylistic/function-call-spacing': 'error',
23
+ '@stylistic/function-paren-newline': ['error', 'consistent'],
24
+ '@stylistic/generator-star-spacing': ['error', 'after'],
25
+ '@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
26
+ '@stylistic/indent': ['error', 2],
27
+ '@stylistic/indent-binary-ops': ['error', 2],
28
+ '@stylistic/key-spacing': ['error', {
29
+ multiLine: {
30
+ afterColon: true,
31
+ beforeColon: false,
32
+ mode: 'strict'
33
+ },
34
+ singleLine: {
35
+ afterColon: true,
36
+ beforeColon: false,
37
+ mode: 'strict'
38
+ }
39
+ }],
40
+ '@stylistic/keyword-spacing': 'error',
41
+ '@stylistic/linebreak-style': ['error', 'unix'],
42
+ '@stylistic/lines-around-comment': ['error', {
43
+ afterHashbangComment: true,
44
+ allowClassStart: true,
45
+ beforeBlockComment: true,
46
+ beforeLineComment: true
47
+ }],
48
+ '@stylistic/lines-between-class-members': ['error', 'always'],
49
+ '@stylistic/max-len': ['error', {
50
+ code: 100,
51
+ comments: 80,
52
+ ignoreTrailingComments: true,
53
+ ignoreUrls: true,
54
+ tabWidth: 2
55
+ }],
56
+ '@stylistic/max-statements-per-line': ['error', { max: 2 }],
57
+ '@stylistic/member-delimiter-style': ['error', {
58
+ multiline: {
59
+ delimiter: 'comma',
60
+ requireLast: true
61
+ },
62
+ multilineDetection: 'brackets',
63
+ singleline: {
64
+ delimiter: 'comma',
65
+ requireLast: false
66
+ }
67
+ }],
68
+ '@stylistic/multiline-ternary': ['error', 'always'],
69
+ '@stylistic/new-parens': ['error', 'always'],
70
+ '@stylistic/newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }],
71
+ '@stylistic/no-confusing-arrow': ['error', {
72
+ allowParens: true,
73
+ onlyOneSimpleParam: true
74
+ }],
75
+ '@stylistic/no-extra-parens': ['error', 'all', {
76
+ nestedBinaryExpressions: false
77
+ }],
78
+ '@stylistic/no-extra-semi': 'error',
79
+ '@stylistic/no-floating-decimal': 'error',
80
+ '@stylistic/no-mixed-operators': 'error',
81
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
82
+ '@stylistic/no-multi-spaces': 'error',
83
+ '@stylistic/no-multiple-empty-lines': ['error', {
84
+ max: 1,
85
+ maxEOF: 1
86
+ }],
87
+ '@stylistic/no-tabs': ['error', { allowIndentationTabs: true }],
88
+ '@stylistic/no-trailing-spaces': ['error', {
89
+ ignoreComments: false,
90
+ skipBlankLines: false
91
+ }],
92
+ '@stylistic/no-whitespace-before-property': 'error',
93
+ '@stylistic/nonblock-statement-body-position': ['error', 'below'],
94
+ '@stylistic/object-curly-newline': ['error', {
95
+ consistent: true,
96
+ minProperties: 3
97
+ }],
98
+ '@stylistic/object-curly-spacing': ['error', 'always', {
99
+ arraysInObjects: false,
100
+ objectsInObjects: false
101
+ }],
102
+ '@stylistic/one-var-declaration-per-line': ['error', 'initializations'],
103
+ '@stylistic/operator-linebreak': ['error', 'after', {
104
+ overrides: {
105
+ ':': 'before',
106
+ '?': 'before'
107
+ }
108
+ }],
109
+ '@stylistic/padded-blocks': ['error', 'never'],
110
+ '@stylistic/quote-props': ['error', 'consistent-as-needed'],
111
+ '@stylistic/quotes': ['error', 'single', {
112
+ allowTemplateLiterals: true,
113
+ avoidEscape: true
114
+ }],
115
+ '@stylistic/rest-spread-spacing': ['error', 'never'],
116
+ '@stylistic/semi': ['error', 'always'],
117
+ '@stylistic/semi-spacing': 'error',
118
+ '@stylistic/semi-style': 'error',
119
+ '@stylistic/space-before-blocks': 'error',
120
+ '@stylistic/space-before-function-paren': ['error', 'never'],
121
+ '@stylistic/space-in-parens': ['error', 'never'],
122
+ '@stylistic/switch-colon-spacing': 'error',
123
+ '@stylistic/template-curly-spacing': 'error',
124
+ '@stylistic/template-tag-spacing': ['error', 'always'],
125
+ '@stylistic/type-annotation-spacing': ['error', {
126
+ after: true,
127
+ before: false,
128
+ overrides: {
129
+ arrow: {
130
+ after: true,
131
+ before: true
132
+ }
133
+ }
134
+ }],
135
+ '@stylistic/type-generic-spacing': 'error',
136
+ '@stylistic/type-named-tuple-spacing': 'error',
137
+ '@stylistic/wrap-regex': 'error',
138
+ '@stylistic/yield-star-spacing': ['error', 'after']
139
+ };
140
+
package/index.js CHANGED
@@ -1,4 +1,6 @@
1
- require('@rushstack/eslint-patch/modern-module-resolution')
1
+ require('@rushstack/eslint-patch/modern-module-resolution');
2
+
3
+ const styleRules = require('./configs/style');
2
4
 
3
5
  module.exports = {
4
6
  env: {
@@ -6,28 +8,50 @@ module.exports = {
6
8
  },
7
9
  extends: [
8
10
  'eslint:recommended',
9
- 'plugin:@typescript-eslint/recommended',
10
- 'plugin:@typescript-eslint/stylistic',
11
+ 'plugin:n/recommended',
12
+ 'plugin:import/recommended',
11
13
  'plugin:unicorn/recommended',
12
- 'xo',
13
- 'xo-typescript/space',
14
- 'plugin:perfectionist/recommended-natural',
14
+ 'plugin:perfectionist/recommended-natural'
15
+ ],
16
+ overrides: [
17
+ {
18
+ extends: [
19
+ 'plugin:@typescript-eslint/recommended',
20
+ 'plugin:import/typescript'
21
+ ],
22
+ files: [ '*.ts' ],
23
+ parser: '@typescript-eslint/parser',
24
+ parserOptions: {
25
+ project: './tsconfig.json'
26
+ },
27
+ plugins: [
28
+ '@typescript-eslint/eslint-plugin'
29
+ ],
30
+ rules: {
31
+ ...styleRules,
32
+ 'import/no-unresolved': 'error'
33
+ },
34
+ settings: {
35
+ 'import/parsers': {
36
+ '@typescript-eslint/parser': [ '.ts' ]
37
+ },
38
+ 'import/resolver': {
39
+ node: true,
40
+ typescript: {
41
+ alwaysTryTypes: true
42
+ }
43
+ }
44
+ }
45
+ }
15
46
  ],
16
- parser: '@typescript-eslint/parser',
17
- parserOptions: {
18
- project: './tsconfig.json',
19
- },
20
47
  plugins: [
21
- '@typescript-eslint/eslint-plugin',
22
- 'import',
23
- 'perfectionist',
24
- 'promise',
25
- 'unicorn'
48
+ 'import',
49
+ 'perfectionist',
50
+ 'unicorn',
51
+ '@stylistic'
26
52
  ],
27
- settings: {
28
- 'import/resolver': {
29
- node: true,
30
- typescript: true,
31
- },
32
- },
33
- }
53
+ rules: {
54
+ ...styleRules
55
+ }
56
+ };
57
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarsec/eslint-config",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "jsec's eslint configurations",
5
5
  "author": "Jarrod Seccombe <jarrod.seccombe@icloud.com>",
6
6
  "main": "index.js",
@@ -9,28 +9,32 @@
9
9
  "access": "public"
10
10
  },
11
11
  "dependencies": {
12
+ "@eslint/js": "^8.57.0",
12
13
  "@rushstack/eslint-patch": "^1.7.2",
13
- "@types/node": "^20.10.8",
14
- "@typescript-eslint/eslint-plugin": "^7.0.2",
15
- "@typescript-eslint/parser": "^7.0.2",
16
- "eslint": "^8.56.0",
17
- "eslint-config-prettier": "^9.1.0",
18
- "eslint-config-xo": "^0.44.0",
19
- "eslint-config-xo-typescript": "^3.0.0",
14
+ "@stylistic/eslint-plugin": "^1.6.3",
15
+ "@types/node": "^20.11.20",
16
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
17
+ "@typescript-eslint/parser": "^7.1.0",
18
+ "eslint": "^8.57.0",
19
+ "eslint-import-resolver-typescript": "^3.6.1",
20
20
  "eslint-plugin-import": "^2.29.1",
21
21
  "eslint-plugin-n": "^16.6.2",
22
22
  "eslint-plugin-perfectionist": "^2.5.0",
23
23
  "eslint-plugin-promise": "^6.1.1",
24
24
  "eslint-plugin-unicorn": "^51.0.1",
25
+ "globals": "^14.0.0",
25
26
  "typescript": "^5.3.3"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/node": "^20.11.16",
29
- "eslint": "^8.56.0",
29
+ "@types/node": "^20.11.20",
30
+ "eslint": "^8.57.0",
30
31
  "typescript": "^5.3.3"
31
32
  },
32
33
  "peerDependencies": {
33
34
  "eslint": "^8.56.0",
34
35
  "typescript": "^5.2.2"
36
+ },
37
+ "scripts": {
38
+ "lint": "eslint --fix ."
35
39
  }
36
40
  }
package/javascript.js DELETED
@@ -1,24 +0,0 @@
1
- require('@rushstack/eslint-patch/modern-module-resolution')
2
-
3
- module.exports = {
4
- env: {
5
- node: true
6
- },
7
- extends: [
8
- 'eslint:recommended',
9
- 'plugin:promise/recommended',
10
- 'plugin:unicorn/recommended',
11
- 'xo',
12
- 'plugin:perfectionist/recommended-natural',
13
- ],
14
- plugins: [
15
- 'import',
16
- 'perfectionist',
17
- 'promise'
18
- ],
19
- settings: {
20
- 'import/resolver': {
21
- node: true,
22
- }
23
- }
24
- }