@asd14/eslint-config 9.2.0 → 10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asd14/eslint-config",
3
- "version": "9.2.0",
3
+ "version": "10.0.0",
4
4
  "description": "JavaScript ESLint rules",
5
5
  "homepage": "https://github.com/asd-xiv/eslint-config",
6
6
  "main": "targets/node.js",
@@ -34,7 +34,7 @@
34
34
  "scripts": {
35
35
  "----UTIL": "",
36
36
  "prepare": "git config --local core.hooksPath .githook",
37
- "setup": "npm ci --also=dev --prefer-offline --no-audit",
37
+ "setup": "npm ci --also=dev --cache .npm --prefer-offline --no-audit",
38
38
  "update": "ncu --interactive",
39
39
  "postupdate": "npm audit fix",
40
40
  "format": "npm run lint.js -- --fix",
@@ -46,17 +46,18 @@
46
46
  "release": "semantic-release"
47
47
  },
48
48
  "lint-staged": {
49
- "*.{js,json}": "eslint --quiet",
49
+ "*.{js}": "eslint --quiet",
50
+ "*.{json}": "prettier",
50
51
  "*.md": "markdownlint --ignore CHANGELOG.md",
51
52
  ".circleci/config.yml": "circleci config validate"
52
53
  },
53
54
  "dependencies": {
54
- "@typescript-eslint/eslint-plugin": "^5.51.0",
55
- "@typescript-eslint/parser": "^5.51.0",
56
- "eslint-config-prettier": "^8.6.0",
55
+ "@typescript-eslint/eslint-plugin": "^5.57.0",
56
+ "@typescript-eslint/parser": "^5.57.0",
57
+ "eslint-config-prettier": "^8.8.0",
57
58
  "eslint-plugin-html": "^7.1.0",
58
59
  "eslint-plugin-import": "^2.27.5",
59
- "eslint-plugin-jsdoc": "^39.8.0",
60
+ "eslint-plugin-jsdoc": "^40.1.1",
60
61
  "eslint-plugin-json": "^3.1.0",
61
62
  "eslint-plugin-no-inferred-method-name": "^2.0.0",
62
63
  "eslint-plugin-no-relative-import-paths": "^1.5.2",
@@ -64,23 +65,23 @@
64
65
  "eslint-plugin-promise": "^6.1.1",
65
66
  "eslint-plugin-react": "^7.32.2",
66
67
  "eslint-plugin-react-hooks": "^4.6.0",
67
- "eslint-plugin-unicorn": "^45.0.2"
68
+ "eslint-plugin-unicorn": "^46.0.0"
68
69
  },
69
70
  "devDependencies": {
70
- "@commitlint/cli": "^17.4.2",
71
- "@commitlint/config-conventional": "^17.4.2",
72
- "@semantic-release/changelog": "^6.0.2",
71
+ "@commitlint/cli": "^17.5.1",
72
+ "@commitlint/config-conventional": "^17.4.4",
73
+ "@semantic-release/changelog": "^6.0.3",
73
74
  "@semantic-release/git": "^10.0.1",
74
- "lint-staged": "^13.1.1",
75
+ "lint-staged": "^13.2.0",
75
76
  "markdownlint-cli": "^0.33.0",
76
- "npm-check-updates": "^16.7.4",
77
- "semantic-release": "^20.1.0"
77
+ "npm-check-updates": "^16.9.0",
78
+ "semantic-release": "^21.0.0"
78
79
  },
79
80
  "peerDependencies": {
80
- "eslint": "^8.33.0",
81
- "prettier": "^2.8.3"
81
+ "eslint": "^8.37.0",
82
+ "prettier": "^2.8.7"
82
83
  },
83
84
  "engines": {
84
- "node": ">=16.0.0"
85
+ "node": ">=18"
85
86
  }
86
87
  }
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ rules: {
3
+ // Encourages use of dot notation whenever possible
4
+ "dot-notation": [
5
+ "error",
6
+ {
7
+ allowKeywords: true,
8
+ },
9
+ ],
10
+ },
11
+ }
package/rules/comments.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  /*
package/rules/errors.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  /*
package/rules/es6.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  // Require braces in arrow function body
package/rules/html.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["html"],
5
3
  settings: {
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  extends: ["plugin:import/typescript"],
5
3
 
package/rules/import.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["import", "no-relative-import-paths"],
5
3
  extends: ["plugin:import/recommended"],
package/rules/jsdoc-ts.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  "valid-jsdoc": "off",
package/rules/jsdoc.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  /*
4
2
  * JSDoc is a JavaScript API documentation generator. It uses
5
3
  * specially-formatted comments inside of code to generate API
package/rules/json.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["json"],
5
3
 
package/rules/node.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  // Enforce return after a callback
package/rules/prettier.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  extends: ["plugin:prettier/recommended"],
5
3
 
package/rules/promise.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["promise"],
5
3
 
package/rules/react.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["react", "react-hooks"],
5
3
 
package/rules/style.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  /*
5
3
  * Disabled by prettier
package/rules/unicorn.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  plugins: ["unicorn"],
5
3
 
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  rules: {
5
3
  // Enforce or disallow variable initializations at definition
@@ -1,18 +1,14 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  parserOptions: {
5
3
  ecmaVersion: 2021,
6
4
  sourceType: "module",
7
5
  },
8
-
9
6
  env: {
10
7
  node: true,
11
8
  },
12
-
13
9
  extends: [
14
10
  "../rules/json",
15
- "../rules/best.practices",
11
+ "../rules/best-practices",
16
12
  "../rules/comments",
17
13
  "../rules/errors",
18
14
  "../rules/es6",
@@ -24,8 +20,6 @@ module.exports = {
24
20
  "../rules/variables",
25
21
  "../rules/prettier",
26
22
  ].map(require.resolve),
27
-
28
23
  plugins: ["no-inferred-method-name"],
29
-
30
24
  settings: {},
31
25
  }
@@ -1,22 +1,17 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  parser: "@typescript-eslint/parser",
5
-
6
3
  parserOptions: {
7
4
  ecmaVersion: 2021,
8
5
  sourceType: "module",
9
6
  },
10
-
11
7
  env: {
12
8
  node: true,
13
9
  es6: true,
14
10
  },
15
-
16
11
  extends: [
17
12
  ...[
18
13
  "../rules/json",
19
- "../rules/best.practices",
14
+ "../rules/best-practices",
20
15
  "../rules/comments",
21
16
  "../rules/errors",
22
17
  "../rules/es6",
@@ -31,12 +26,9 @@ module.exports = {
31
26
  "../rules/variables",
32
27
  "../rules/prettier",
33
28
  ].map(require.resolve),
34
-
35
29
  "plugin:@typescript-eslint/recommended",
36
30
  ],
37
-
38
31
  plugins: ["no-inferred-method-name"],
39
-
40
32
  rules: {
41
33
  "@typescript-eslint/no-var-requires": "off",
42
34
  "@typescript-eslint/ban-ts-comment": "warn",
package/targets/node.js CHANGED
@@ -1,18 +1,14 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  parserOptions: {
5
3
  ecmaVersion: 2021,
6
4
  sourceType: "module",
7
5
  },
8
-
9
6
  env: {
10
7
  node: true,
11
8
  },
12
-
13
9
  extends: [
14
10
  "../rules/json",
15
- "../rules/best.practices",
11
+ "../rules/best-practices",
16
12
  "../rules/comments",
17
13
  "../rules/errors",
18
14
  "../rules/es6",
@@ -25,9 +21,7 @@ module.exports = {
25
21
  "../rules/variables",
26
22
  "../rules/prettier",
27
23
  ].map(require.resolve),
28
-
29
24
  plugins: ["no-inferred-method-name"],
30
-
31
25
  settings: {
32
26
  "import/resolver": {
33
27
  node: {
@@ -1,6 +1,5 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
2
+ parser: "@typescript-eslint/parser",
4
3
  parserOptions: {
5
4
  ecmaVersion: 2021,
6
5
  sourceType: "module",
@@ -8,17 +7,15 @@ module.exports = {
8
7
  jsx: true,
9
8
  },
10
9
  },
11
-
12
10
  env: {
13
11
  browser: true,
14
12
  es6: true,
15
13
  node: false,
16
14
  },
17
-
18
15
  extends: [
19
16
  ...[
20
17
  "../rules/json",
21
- "../rules/best.practices",
18
+ "../rules/best-practices",
22
19
  "../rules/comments",
23
20
  "../rules/errors",
24
21
  "../rules/es6",
@@ -37,9 +34,7 @@ module.exports = {
37
34
 
38
35
  "plugin:@typescript-eslint/recommended",
39
36
  ],
40
-
41
37
  plugins: ["no-inferred-method-name"],
42
-
43
38
  rules: {
44
39
  "react/prop-types": "off",
45
40
 
@@ -70,7 +65,6 @@ module.exports = {
70
65
  },
71
66
  ],
72
67
  },
73
-
74
68
  settings: {
75
69
  "react": {
76
70
  version: "detect",
package/targets/react.js CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-env node */
2
-
3
1
  module.exports = {
4
2
  parserOptions: {
5
3
  ecmaVersion: 2021,
@@ -19,7 +17,7 @@ module.exports = {
19
17
 
20
18
  extends: [
21
19
  "../rules/json",
22
- "../rules/best.practices",
20
+ "../rules/best-practices",
23
21
  "../rules/comments",
24
22
  "../rules/errors",
25
23
  "../rules/es6",
@@ -1,200 +0,0 @@
1
- /* eslint-env node */
2
-
3
- module.exports = {
4
- rules: {
5
- // Enforces getter/setter pairs in objects
6
- "accessor-pairs": 0,
7
-
8
- // Treat var statements as if they were block scoped
9
- "block-scoped-var": "error",
10
-
11
- // Specify the maximum cyclomatic complexity allowed in a program
12
- "complexity": [0, 5],
13
-
14
- // Require return statements to either always or never specify values
15
- "consistent-return": "warn",
16
-
17
- // Require default case in switch statements
18
- "default-case": "error",
19
-
20
- // Encourages use of dot notation whenever possible
21
- "dot-notation": [
22
- "error",
23
- {
24
- allowKeywords: true,
25
- },
26
- ],
27
-
28
- // Require the use of === and !==
29
- "eqeqeq": "error",
30
-
31
- // Make sure for-in loops have an if statement
32
- "guard-for-in": "error",
33
-
34
- // Disallow the use of alert, confirm, and prompt
35
- "no-alert": 1,
36
-
37
- // Disallow use of arguments.caller or arguments.callee
38
- "no-caller": "error",
39
-
40
- // Disallow lexical declarations in case clauses
41
- "no-case-declarations": "error",
42
-
43
- /*
44
- * Disallow division operators explicitly at beginning of regular
45
- * expression
46
- */
47
- "no-div-regex": 0,
48
-
49
- // Disallow else after a return in an if
50
- "no-else-return": [
51
- "error",
52
- {
53
- allowElseIf: false,
54
- },
55
- ],
56
-
57
- // Disallow use of empty destructuring patterns
58
- "no-empty-pattern": 0,
59
-
60
- // Disallow comparisons to null without a type-checking operator
61
- "no-eq-null": 0,
62
-
63
- // Disallow use of eval()
64
- "no-eval": "error",
65
-
66
- // Disallow adding to native types
67
- "no-extend-native": "error",
68
-
69
- // Disallow unnecessary function binding
70
- "no-extra-bind": "error",
71
-
72
- // Disallow fallthrough of case statements
73
- "no-fallthrough": "error",
74
-
75
- // Disallow the type conversions with shorter notations
76
- "no-implicit-coercion": 0,
77
-
78
- // Disallow use of eval()-like methods
79
- "no-implied-eval": "error",
80
-
81
- // Disallow this keywords outside of classes or class-like objects
82
- "no-invalid-this": 0,
83
-
84
- // Disallow usage of __iterator__ property
85
- "no-iterator": "error",
86
-
87
- // Disallow use of labels for anything other then loops and switches
88
- "no-label": 0,
89
-
90
- // Disallow use of labeled statements
91
- "no-labels": "error",
92
-
93
- // Disallow unnecessary nested blocks
94
- "no-lone-blocks": "warn",
95
-
96
- // Disallow creation of functions within loops
97
- "no-loop-func": "error",
98
-
99
- // Disallow the use of magic numbers
100
- "no-magic-numbers": 0,
101
-
102
- // Disallow use of multiline strings
103
- "no-multi-str": "error",
104
-
105
- // Disallow reassignments of native objects
106
- "no-native-reassign": "error",
107
-
108
- /*
109
- * Disallow use of new operator when not part of the assignment or
110
- * Comparison
111
- */
112
- "no-new": "error",
113
-
114
- // Disallow use of new operator for Function object
115
- "no-new-func": "error",
116
-
117
- // Disallows creating new instances of String,Number, and Boolean
118
- "no-new-wrappers": "error",
119
-
120
- // Disallow use of (old style) octal literals
121
- "no-octal": "error",
122
-
123
- /*
124
- * Disallow use of octal escape sequences in string literals, such as
125
- * Var foo = "Copyright \251";
126
- */
127
- "no-octal-escape": "error",
128
-
129
- // Disallow reassignment of function parameters
130
- "no-param-reassign": [
131
- "error",
132
- {
133
- props: false,
134
- },
135
- ],
136
-
137
- // Disallow use of process.env
138
- "no-process-env": 0,
139
-
140
- // Disallow usage of __proto__ property
141
- "no-proto": "error",
142
-
143
- // Disallow declaring the same variable more then once
144
- "no-redeclare": "error",
145
-
146
- // Disallow use of assignment in return statement
147
- "no-return-assign": "error",
148
-
149
- // Disallow use of `javascript:` urls.
150
- "no-script-url": "error",
151
-
152
- // Disallow comparisons where both sides are exactly the same
153
- "no-self-compare": "error",
154
-
155
- // Disallow use of comma operator
156
- "no-sequences": "error",
157
-
158
- // Restrict what can be thrown as an exception
159
- "no-throw-literal": "error",
160
-
161
- // Disallow usage of expressions in statement position
162
- "no-unused-expressions": [
163
- "error",
164
- {
165
- allowShortCircuit: true,
166
- allowTernary: true,
167
- },
168
- ],
169
-
170
- // Disallow unnecessary .call() and .apply()
171
- "no-useless-call": 0,
172
-
173
- // Disallow unnecessary concatenation of literals or template literals
174
- "no-useless-concat": 0,
175
-
176
- // Disallow use of void operator
177
- "no-void": 0,
178
-
179
- // Disallow usage of configurable warning terms in comments: e.g. todo
180
- "no-warning-comments": [
181
- 0,
182
- {
183
- location: "start",
184
- terms: ["todo", "fixme", "xxx"],
185
- },
186
- ],
187
-
188
- // Disallow use of the with statement
189
- "no-with": "error",
190
-
191
- // Require use of the second argument for parseInt()
192
- "radix": "error",
193
-
194
- // Requires to declare all vars on top of their containing scope
195
- "vars-on-top": "error",
196
-
197
- // Require or disallow Yoda conditions
198
- "yoda": 0,
199
- },
200
- }