@prowise/eslint-config-linting-rules 0.0.3 → 0.0.5

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/backend.js CHANGED
@@ -5,11 +5,6 @@ module.exports = {
5
5
 
6
6
  env: { node: true },
7
7
 
8
- globals: {
9
- Atomics: "readonly",
10
- SharedArrayBuffer: "readonly",
11
- },
12
-
13
8
  plugins: ["eslint-plugin-node"],
14
9
 
15
10
  rules: { ...nodeRules },
package/frontend.js CHANGED
@@ -6,6 +6,12 @@ module.exports = {
6
6
 
7
7
  env: { browser: true },
8
8
 
9
+ settings: {
10
+ react: {
11
+ version: "detect",
12
+ },
13
+ },
14
+
9
15
  globals: {
10
16
  Atomics: "readonly",
11
17
  SharedArrayBuffer: "readonly",
package/index.js CHANGED
@@ -39,6 +39,14 @@ module.exports = {
39
39
  "jest/no-identical-title": "error",
40
40
  "jest/prefer-to-have-length": "warn",
41
41
  "jest/valid-expect": "error",
42
- "prettier/prettier": ["error", { singleQuote: false, tabWidth: 4, printWidth: 120, trailingComma: "all" }],
42
+ "prettier/prettier": [
43
+ "error",
44
+ {
45
+ singleQuote: false,
46
+ tabWidth: 4,
47
+ printWidth: 120,
48
+ trailingComma: "all",
49
+ },
50
+ ],
43
51
  },
44
52
  };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@prowise/eslint-config-linting-rules","version":"0.0.3","description":"Default Prowise linting rules for npm packages.","main":"index.js","exports":{"./typescript":"./typescript.js","./backend":"./backend.js","./frontend":"./frontend.js"},"scripts":{"lint":"eslint ."},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/prowise/npm-linting-rules.git"},"author":"Prowise B.V.","license":"UNLICENSED","homepage":"https://bitbucket.org/prowise/npm-linting-rules#readme","dependencies":{"@typescript-eslint/eslint-plugin":"^5.36.2","@typescript-eslint/parser":"^5.36.2","confusing-browser-globals":"^1.0.11","eslint":"^8.23.0","eslint-import-resolver-typescript":"^3.5.1","eslint-plugin-import":"^2.26.0","eslint-plugin-jest":"^27.0.1","eslint-plugin-jsdoc":"^39.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-prefer-arrow":"^1.2.3","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.31.7","eslint-plugin-react-hooks":"^4.6.0","object.assign":"^4.1.4","prettier":"^2.7.1","semver":"^7.3.7"}}
1
+ {"name":"@prowise/eslint-config-linting-rules","version":"0.0.5","description":"Default Prowise linting rules for npm packages.","main":"index.js","exports":{"./typescript":"./typescript.js","./backend":"./backend.js","./frontend":"./frontend.js"},"scripts":{"lint":"eslint ."},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/prowise/npm-linting-rules.git"},"author":"Prowise B.V.","license":"UNLICENSED","homepage":"https://bitbucket.org/prowise/npm-linting-rules#readme","dependencies":{"@typescript-eslint/eslint-plugin":"^5.36.2","@typescript-eslint/parser":"^5.36.2","confusing-browser-globals":"^1.0.11","eslint":"^8.23.0","eslint-import-resolver-typescript":"^3.5.1","eslint-plugin-import":"^2.26.0","eslint-plugin-jest":"^27.0.1","eslint-plugin-jsdoc":"^39.3.6","eslint-plugin-node":"^11.1.0","eslint-plugin-prefer-arrow":"^1.2.3","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.31.7","eslint-plugin-react-hooks":"^4.6.0","object.assign":"^4.1.4","prettier":"^2.7.1","semver":"^7.3.7"}}
@@ -482,7 +482,7 @@ module.exports = {
482
482
  * Enforces use of function declarations
483
483
  * https://eslint.org/docs/latest/rules/func-style.
484
484
  */
485
- "func-style": ["error", "declaration"],
485
+ "func-style": ["error", "declaration", { allowArrowFunctions: true }],
486
486
 
487
487
  /**
488
488
  * Require grouped accessor pairs in object literals and classes
@@ -545,7 +545,15 @@ module.exports = {
545
545
  * Enforce a maximum function length
546
546
  * https://eslint.org/docs/latest/rules/max-lines-per-function.
547
547
  */
548
- "max-lines-per-function": ["off", { max: 50, skipBlankLines: true, skipComments: true, IIFEs: true }],
548
+ "max-lines-per-function": [
549
+ "off",
550
+ {
551
+ max: 50,
552
+ skipBlankLines: true,
553
+ skipComments: true,
554
+ IIFEs: true,
555
+ },
556
+ ],
549
557
 
550
558
  /**
551
559
  * Specify the maximum depth callbacks can be nested
@@ -1786,10 +1794,10 @@ module.exports = {
1786
1794
  "object-curly-newline": [
1787
1795
  "error",
1788
1796
  {
1789
- ObjectExpression: { minProperties: 5, multiline: true, consistent: true },
1790
- ObjectPattern: { minProperties: 5, multiline: true, consistent: true },
1791
- ImportDeclaration: { minProperties: 5, multiline: true, consistent: true },
1792
- ExportDeclaration: { minProperties: 5, multiline: true, consistent: true },
1797
+ ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
1798
+ ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
1799
+ ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
1800
+ ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
1793
1801
  },
1794
1802
  ],
1795
1803
 
@@ -293,7 +293,13 @@ module.exports = {
293
293
  "error",
294
294
  {
295
295
  groups: [["builtin", "external", "internal"]],
296
- alphabetize: { order: "asc", caseInsensitive: true },
296
+ pathGroups: [
297
+ {
298
+ pattern: "react",
299
+ group: "external",
300
+ position: "before",
301
+ },
302
+ ],
297
303
  },
298
304
  ],
299
305
 
@@ -301,7 +307,7 @@ module.exports = {
301
307
  * Require modules with a single export to use a default export
302
308
  * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md.
303
309
  */
304
- "import/prefer-default-export": "error",
310
+ "import/prefer-default-export": "off",
305
311
 
306
312
  /**
307
313
  * Warn if a module could be mistakenly parsed as a script by a consumer
@@ -130,7 +130,7 @@ module.exports = {
130
130
  "react/function-component-definition": [
131
131
  "error",
132
132
  {
133
- namedComponents: ["function-declaration", "function-expression"],
133
+ namedComponents: ["function-declaration", "function-expression", "arrow-function"],
134
134
  unnamedComponents: "function-expression",
135
135
  },
136
136
  ],
@@ -540,7 +540,7 @@ module.exports = {
540
540
  * Disallow file extensions that may contain JSX
541
541
  * https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md.
542
542
  */
543
- "react/jsx-filename-extension": ["error", { extensions: [".jsx"] }],
543
+ "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
544
544
 
545
545
  /**
546
546
  * Enforce proper position of the first property in JSX
@@ -676,13 +676,13 @@ module.exports = {
676
676
  * Require private members to be marked as readonly if they"re never modified outside of the constructor 🔧 💭
677
677
  * https://typescript-eslint.io/rules/prefer-readonly.
678
678
  */
679
- "@typescript-eslint/prefer-readonly": "warn",
679
+ "@typescript-eslint/prefer-readonly": ["warn", { ignoreInferredTypes: true }],
680
680
 
681
681
  /**
682
682
  * Require function parameters to be typed as readonly to prevent accidental mutation of inputs 💭
683
683
  * https://typescript-eslint.io/rules/prefer-readonly-parameter-types.
684
684
  */
685
- "@typescript-eslint/prefer-readonly-parameter-types": "warn",
685
+ "@typescript-eslint/prefer-readonly-parameter-types": ["warn", { ignoreInferredTypes: true }],
686
686
 
687
687
  /**
688
688
  * Enforce using type parameter when calling Array#reduce instead of casting 🔒 🔧 💭