@nfq/eslint-config 2.2.9 → 2.3.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
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.3.0](https://github.com/nfqde/eslint-config-nfq/compare/v2.2.11...v2.3.0) (2023-04-21)
6
+
7
+
8
+ ### Features
9
+
10
+ * **Curly, NoMagic:** Update rules to be a bit more lax ([#37](https://github.com/nfqde/eslint-config-nfq/issues/37)) ([a211764](https://github.com/nfqde/eslint-config-nfq/commit/a21176478f62fe8fdae46566290a0a0eff6c593b))
11
+
12
+ ### [2.2.11](https://github.com/nfqde/eslint-config-nfq/compare/v2.2.10...v2.2.11) (2023-03-04)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **Rules:** fix some rules ([#36](https://github.com/nfqde/eslint-config-nfq/issues/36)) ([5c0a5f1](https://github.com/nfqde/eslint-config-nfq/commit/5c0a5f1a76ae7020d02abb50ef7862af42fb22e8))
18
+
19
+ ### [2.2.10](https://github.com/nfqde/eslint-config-nfq/compare/v2.2.9...v2.2.10) (2023-03-02)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **es6:** Remove depricated rule: prefer-reflect ([#31](https://github.com/nfqde/eslint-config-nfq/issues/31)) ([d582b4f](https://github.com/nfqde/eslint-config-nfq/commit/d582b4fb104e4921df9c3e8c98858aba7b43926d))
25
+ * **jsdoc:** Remove depricated jsdoc rules ([#29](https://github.com/nfqde/eslint-config-nfq/issues/29)) ([1d4ee15](https://github.com/nfqde/eslint-config-nfq/commit/1d4ee15abc882654a60055821483cac386462100))
26
+ * **React:** Repalace depricated rule with sort-default-props ([#35](https://github.com/nfqde/eslint-config-nfq/issues/35)) ([1348de8](https://github.com/nfqde/eslint-config-nfq/commit/1348de8a19e40a7a7cf5e05da5dac2097754c4b3))
27
+ * **Style:** Remove depricated and already replaced no-spaced-func ([#33](https://github.com/nfqde/eslint-config-nfq/issues/33)) ([266b936](https://github.com/nfqde/eslint-config-nfq/commit/266b9364416c138a60451d7021e95104eef6ae69))
28
+ * **Style:** Replace depricated line between rules ([#34](https://github.com/nfqde/eslint-config-nfq/issues/34)) ([581a48d](https://github.com/nfqde/eslint-config-nfq/commit/581a48d8582dd7fc8a9c40f9466424213377047a))
29
+ * **Style:** Replace depricated rule id-blacklist with id-denylist ([#32](https://github.com/nfqde/eslint-config-nfq/issues/32)) ([b804fe6](https://github.com/nfqde/eslint-config-nfq/commit/b804fe6c5d5ce6d28a916329dc516fbf4519353c))
30
+ * **Variables:** Remove depricated rule: no-catch-shadow ([#30](https://github.com/nfqde/eslint-config-nfq/issues/30)) ([ed9ac8c](https://github.com/nfqde/eslint-config-nfq/commit/ed9ac8c74ceeba62adb32dea18b60e8a40f23c0e))
31
+
5
32
  ### [2.2.9](https://github.com/nfqde/eslint-config-nfq/compare/v2.2.8...v2.2.9) (2022-11-15)
6
33
 
7
34
 
package/config/globals.js CHANGED
@@ -11,6 +11,7 @@ module.exports = {
11
11
  describe: false,
12
12
  expect: false,
13
13
  it: false,
14
+ JQuery: false,
14
15
  JSX: false,
15
16
  NodeJs: false
16
17
  };
package/index.js CHANGED
@@ -16,7 +16,7 @@ module.exports = {
16
16
  {
17
17
  files: ['**/*.{ts,cts,mts,tsx}'],
18
18
  parser: '@typescript-eslint/parser',
19
- parserOptions: {project: './tsconfig.json'},
19
+ parserOptions: {project: '**/tsconfig*.json'},
20
20
  plugins: ['@typescript-eslint'],
21
21
  rules: typescript.rules
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nfq/eslint-config",
3
- "version": "2.2.9",
3
+ "version": "2.3.0",
4
4
  "engines": {
5
5
  "node": ">= 12.0.0"
6
6
  },
@@ -17,6 +17,7 @@
17
17
  "config"
18
18
  ],
19
19
  "peerDependencies": {
20
+ "@babel/core": ">= 7",
20
21
  "@babel/eslint-parser": ">= 7",
21
22
  "@nfq/eslint-plugin": ">= 0.6.0",
22
23
  "@typescript-eslint/eslint-plugin": ">= 5",
@@ -26,12 +27,12 @@
26
27
  "eslint-plugin-array-func": ">= 3",
27
28
  "eslint-plugin-better-styled-components": ">= 1",
28
29
  "eslint-plugin-import": ">= 2",
29
- "eslint-plugin-jsdoc": ">= 39",
30
+ "eslint-plugin-jsdoc": ">= 40",
30
31
  "eslint-plugin-jsx-a11y": ">= 6",
31
- "eslint-plugin-no-unsanitized": ">= 3",
32
+ "eslint-plugin-no-unsanitized": ">= 4",
32
33
  "eslint-plugin-node": ">= 11",
33
34
  "eslint-plugin-perf-standard": ">= 1",
34
- "eslint-plugin-promise": ">= 5",
35
+ "eslint-plugin-promise": ">= 6",
35
36
  "eslint-plugin-react": ">= 7",
36
37
  "eslint-plugin-react-hooks": ">= 4",
37
38
  "eslint-plugin-react-hooks-ssr": ">= 0.1.5",
@@ -43,28 +44,28 @@
43
44
  "confusing-browser-globals": "^1.0.11"
44
45
  },
45
46
  "devDependencies": {
46
- "@babel/core": "^7.18.9",
47
- "@babel/eslint-parser": "^7.18.9",
47
+ "@babel/core": "^7.21.4",
48
+ "@babel/eslint-parser": "^7.21.3",
48
49
  "@nfq/eslint-plugin": "^0.6.0",
49
- "@typescript-eslint/eslint-plugin": "^5.30.7",
50
- "@typescript-eslint/parser": "^5.30.7",
51
- "eslint": "^8.20.0",
50
+ "@typescript-eslint/eslint-plugin": "^5.59.0",
51
+ "@typescript-eslint/parser": "^5.59.0",
52
+ "eslint": "^8.38.0",
52
53
  "eslint-import-resolver-alias": "^1.1.2",
53
- "eslint-plugin-array-func": "^3.1.7",
54
+ "eslint-plugin-array-func": "^3.1.8",
54
55
  "eslint-plugin-better-styled-components": "^1.1.2",
55
- "eslint-plugin-import": "^2.26.0",
56
- "eslint-plugin-jsdoc": "^39.3.3",
57
- "eslint-plugin-jsx-a11y": "^6.6.0",
58
- "eslint-plugin-no-unsanitized": "^4.0.1",
56
+ "eslint-plugin-import": "^2.27.5",
57
+ "eslint-plugin-jsdoc": "^41.1.2",
58
+ "eslint-plugin-jsx-a11y": "^6.7.1",
59
+ "eslint-plugin-no-unsanitized": "^4.0.2",
59
60
  "eslint-plugin-node": "^11.1.0",
60
61
  "eslint-plugin-perf-standard": "^1.0.3",
61
- "eslint-plugin-promise": "^6.0.0",
62
- "eslint-plugin-react": "^7.30.1",
62
+ "eslint-plugin-promise": "^6.1.1",
63
+ "eslint-plugin-react": "^7.32.2",
63
64
  "eslint-plugin-react-hooks": "^4.6.0",
64
65
  "eslint-plugin-react-hooks-ssr": "^0.1.5",
65
- "eslint-plugin-redos": "^4.4.1",
66
- "eslint-plugin-security": "^1.5.0",
67
- "eslint-plugin-sort-destructure-keys": "^1.4.0"
66
+ "eslint-plugin-redos": "4.4.5",
67
+ "eslint-plugin-security": "^1.7.1",
68
+ "eslint-plugin-sort-destructure-keys": "^1.5.0"
68
69
  },
69
70
  "author": ".NFQ | Christoph Kruppe",
70
71
  "license": "ISC"
@@ -10,7 +10,7 @@ module.exports = {
10
10
  ignore: [0, 1],
11
11
  ignoreArrayIndexes: true,
12
12
  ignoreArrays: true,
13
- ignoreFunctions: ['setTimeout', 'setInterval']
13
+ ignoreFunctions: ['setTimeout', 'setInterval', 'spacing']
14
14
  }
15
15
  ], // disallow magic numbers http://eslint.org/docs/rules/no-magic-numbers
16
16
  'accessor-pairs': [
@@ -25,7 +25,7 @@ module.exports = {
25
25
  'class-methods-use-this': ['off', {exceptMethods: []}], // enforce that class methods use "this" http://eslint.org/docs/rules/class-methods-use-this
26
26
  complexity: ['warn', {max: 20}], // specify the maximum cyclomatic complexity allowed in a program https://eslint.org/docs/rules/complexity
27
27
  'consistent-return': 'error', // require return statements to either always or never specify values https://eslint.org/docs/rules/consistent-return
28
- curly: 'error', // specify curly brace conventions for all control statements https://eslint.org/docs/rules/curly#top
28
+ curly: ['error', 'multi-line', 'consistent'], // specify curly brace conventions for all control statements https://eslint.org/docs/rules/curly#top
29
29
  'default-case': ['warn', {commentPattern: '^no default$'}], // require default case in switch statements https://eslint.org/docs/rules/default-case
30
30
  'default-param-last': 'error', // Checks if default params are last https://eslint.org/docs/rules/default-param-last
31
31
  'dot-location': ['error', 'property'], // enforces consistent newlines before or after dots http://eslint.org/docs/rules/dot-location
package/rules/errors.js CHANGED
@@ -49,7 +49,6 @@ module.exports = {
49
49
  'no-unsafe-negation': 'error', // disallow negating the left operand of relational operators https://eslint.org/docs/rules/no-unsafe-negation
50
50
  'require-atomic-updates': 'off', // Disallow assignments that can lead to race conditions due to usage of await or yield https://eslint.org/docs/rules/require-atomic-updates
51
51
  'use-isnan': 'error', // disallow comparisons with the value NaN https://eslint.org/docs/rules/use-isnan
52
- 'valid-jsdoc': 'off', // ensure JSDoc comments are valid https://eslint.org/docs/rules/valid-jsdoc
53
52
  'valid-typeof': ['error', {requireStringLiterals: true}] // ensure that the results of typeof are compared against a valid string https://eslint.org/docs/rules/valid-typeof
54
53
  }
55
54
  };
package/rules/es6.js CHANGED
@@ -81,7 +81,6 @@ module.exports = {
81
81
  {enforceForRenamedProperties: false}
82
82
  ], // Prefer destructuring from arrays and objects https://eslint.org/docs/rules/prefer-destructuring
83
83
  'prefer-numeric-literals': 'error', // disallow parseInt() in favor of binary, octal, and hexadecimal literals https://eslint.org/docs/rules/prefer-numeric-literals
84
- 'prefer-reflect': 'off', // suggest using Reflect methods where applicable https://eslint.org/docs/rules/prefer-reflect
85
84
  'prefer-rest-params': 'error', // use rest parameters instead of arguments https://eslint.org/docs/rules/prefer-rest-params
86
85
  'prefer-spread': 'error', // suggest using the spread operator instead of .apply() https://eslint.org/docs/rules/prefer-spread
87
86
  'prefer-template': 'error', // suggest using template literals instead of string concatenation https://eslint.org/docs/rules/prefer-template
package/rules/react.js CHANGED
@@ -169,7 +169,6 @@ module.exports = {
169
169
  html: 'enforce'
170
170
  }
171
171
  ], // Disallow JSX props spreading https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
172
- 'react/jsx-sort-default-props': ['error', {ignoreCase: true}], // Enforce defaultProps declarations alphabetical sorting https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/jsx-sort-default-props.md
173
172
  'react/jsx-sort-props': [
174
173
  'error',
175
174
  {
@@ -302,6 +301,7 @@ module.exports = {
302
301
  ]
303
302
  }
304
303
  ], // Enforce component methods order https://github.com/yannickcr/eslint-plugin-react/blob/843d71a432baf0f01f598d7cf1eea75ad6896e4b/docs/rules/sort-comp.md
304
+ 'react/sort-default-props': ['error', {ignoreCase: true}], // Enforce defaultProps declarations alphabetical sorting https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md
305
305
  'react/sort-prop-types': [
306
306
  'error',
307
307
  {
package/rules/style.js CHANGED
@@ -80,7 +80,7 @@ module.exports = {
80
80
  'func-style': ['off', 'expression'], // enforces use of function declarations or expressions https://eslint.org/docs/rules/func-style
81
81
  'function-call-argument-newline': ['error', 'consistent'], // https://eslint.org/docs/rules/function-call-argument-newline
82
82
  'function-paren-newline': ['error', 'consistent'], // enforce consistent line breaks inside function parentheses https://eslint.org/docs/rules/function-paren-newline
83
- 'id-blacklist': 'off', // Blacklist certain identifiers to prevent them being used https://eslint.org/docs/rules/id-blacklist
83
+ 'id-denylist': 'off', // Blacklist certain identifiers to prevent them being used https://eslint.org/docs/rules/id-denylist
84
84
  'id-length': 'off', // this option enforces minimum and maximum identifier lengths (variable names, property names etc.) https://eslint.org/docs/rules/id-length
85
85
  'id-match': 'off', // require identifiers to match the provided regular expression https://eslint.org/docs/rules/id-match
86
86
  'implicit-arrow-linebreak': ['error', 'beside'], // Enforce the location of arrow function bodies with implicit returns https://eslint.org/docs/rules/implicit-arrow-linebreak
@@ -126,7 +126,7 @@ module.exports = {
126
126
  VariableDeclarator: 'first'
127
127
  }
128
128
  ], // this option sets a specific tab width for your code https://eslint.org/docs/rules/indent
129
- 'jsx-quotes': ['off', 'prefer-double'], // specify whether double or single quotes should be used in JSX attributes https://eslint.org/docs/rules/jsx-quotes
129
+ 'jsx-quotes': ['error', 'prefer-double'], // specify whether double or single quotes should be used in JSX attributes https://eslint.org/docs/rules/jsx-quotes
130
130
  'key-spacing': [
131
131
  'error',
132
132
  {
@@ -152,13 +152,6 @@ module.exports = {
152
152
  ], // enforce position of line comments https://eslint.org/docs/rules/line-comment-position
153
153
  'linebreak-style': ['error', 'unix'], // disallow mixed 'LF' and 'CRLF' as linebreaks https://eslint.org/docs/rules/linebreak-style
154
154
  'lines-around-comment': 'off', // enforces empty lines around comments https://eslint.org/docs/rules/lines-around-comment
155
- 'lines-around-directive': [
156
- 'error',
157
- {
158
- after: 'always',
159
- before: 'always'
160
- }
161
- ], // require or disallow newlines around directives https://eslint.org/docs/rules/lines-around-directive
162
155
  'lines-between-class-members': [
163
156
  'error',
164
157
  'always',
@@ -208,8 +201,6 @@ module.exports = {
208
201
  }
209
202
  ], // require a capital letter for constructors https://eslint.org/docs/rules/new-cap
210
203
  'new-parens': ['error', 'always'], // disallow the omission of parentheses when invoking a constructor with no arguments https://eslint.org/docs/rules/new-parens
211
- 'newline-after-var': 'off', // allow/disallow an empty newline after var statement https://eslint.org/docs/rules/newline-after-var
212
- 'newline-before-return': 'error', // https://eslint.org/docs/rules/newline-before-return
213
204
  'newline-per-chained-call': [
214
205
  'error',
215
206
  {ignoreChainWithDepth: 4}
@@ -261,7 +252,6 @@ module.exports = {
261
252
  selector: 'WithStatement'
262
253
  }
263
254
  ], // disallow certain syntax forms https://eslint.org/docs/rules/no-restricted-syntax
264
- 'no-spaced-func': 'error', // disallow space between function identifier and application https://eslint.org/docs/rules/no-spaced-func
265
255
  'no-tabs': 'error', // disallow tab characters entirely https://eslint.org/docs/rules/no-tabs
266
256
  'no-ternary': 'off', // disallow the use of ternary operators https://eslint.org/docs/rules/no-ternary
267
257
  'no-trailing-spaces': 'error', // disallow trailing whitespace at the end of lines https://eslint.org/docs/rules/no-trailing-spaces
@@ -309,6 +299,21 @@ module.exports = {
309
299
  blankLine: 'any',
310
300
  next: ['const', 'let', 'var'],
311
301
  prev: ['const', 'let', 'var']
302
+ },
303
+ {
304
+ blankLine: "always",
305
+ prev: "directive",
306
+ next: "*"
307
+ },
308
+ {
309
+ blankLine: "any",
310
+ prev: "directive",
311
+ next: "directive"
312
+ },
313
+ {
314
+ blankLine: "always",
315
+ prev: "*",
316
+ next: "return"
312
317
  }
313
318
  ], // Require or disallow padding lines between statements https://eslint.org/docs/rules/padding-line-between-statements
314
319
  'prefer-exponentiation-operator': 'error', // Disallow the use of Math.pow in favor of the ** operator https://eslint.org/docs/rules/prefer-exponentiation-operator
@@ -327,7 +332,6 @@ module.exports = {
327
332
  'single',
328
333
  {avoidEscape: true}
329
334
  ], // specify whether double or single quotes should be used
330
- 'require-jsdoc': 'off', // do not require jsdoc https://eslint.org/docs/rules/require-jsdoc
331
335
  semi: ['error', 'always'], // require or disallow use of semicolons instead of ASI https://eslint.org/docs/rules/semi
332
336
  'semi-spacing': [
333
337
  'error',
@@ -92,7 +92,13 @@ module.exports = {
92
92
  '@typescript-eslint/no-loss-of-precision': 'error',
93
93
  '@typescript-eslint/no-misused-new': 'error',
94
94
  '@typescript-eslint/no-misused-promises': ['error', {checksVoidReturn: false}],
95
- '@typescript-eslint/no-namespace': 'error',
95
+ '@typescript-eslint/no-namespace': [
96
+ 'error',
97
+ {
98
+ allowDeclarations: true,
99
+ allowDefinitionFiles: true
100
+ }
101
+ ],
96
102
  '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
97
103
  '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
98
104
  '@typescript-eslint/no-non-null-assertion': 'off',
@@ -4,7 +4,6 @@ const confusingBrowserGlobals = require('confusing-browser-globals');
4
4
  module.exports = {
5
5
  rules: {
6
6
  'init-declarations': 'off', // enforce or disallow variable initializations at definition https://eslint.org/docs/rules/init-declarations
7
- 'no-catch-shadow': 'error', // disallow the catch clause parameter name being the same as a variable in the outer scope https://eslint.org/docs/rules/no-catch-shadow
8
7
  'no-delete-var': 'error', // disallow deletion of variables https://eslint.org/docs/rules/no-delete-var
9
8
  'no-label-var': 'error', // disallow labels that share a name with a variable https://eslint.org/docs/rules/no-label-var
10
9
  'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(confusingBrowserGlobals), // disallow specific globals https://eslint.org/docs/rules/no-restricted-globals