@perfective/eslint-config-react 0.5.0 → 0.6.0-beta

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/index.js CHANGED
@@ -50,7 +50,9 @@ module.exports = {
50
50
  {
51
51
  files: ['*.@(spec|test).[jt]s?(x)'],
52
52
  rules: {
53
- 'testing-library/no-unnecessary-act': 'error',
53
+ 'testing-library/no-unnecessary-act': ['error', {
54
+ isStrict: true,
55
+ }],
54
56
  },
55
57
  },
56
58
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config-react",
3
- "version": "0.5.0",
3
+ "version": "0.6.0-beta",
4
4
  "description": "ESLint shareable rules configuration for React",
5
5
  "keywords": ["react", "code quality", "code standard", "code style", "eslint", "eslint-config", "lint", "perfective", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -11,14 +11,14 @@
11
11
  },
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
- "@perfective/eslint-config": "~0.15.0"
14
+ "@perfective/eslint-config": "~0.16.0-beta.1"
15
15
  },
16
16
  "peerDependencies": {
17
- "eslint-plugin-jsx-a11y": "^6.4.1",
18
- "eslint-plugin-react": "^7.24.0",
19
- "eslint-plugin-react-hooks": "^4.2.0",
17
+ "eslint-plugin-jsx-a11y": "^6.5.1",
18
+ "eslint-plugin-react": "^7.28.0",
19
+ "eslint-plugin-react-hooks": "^4.3.0",
20
20
  "eslint-plugin-react-hooks-ssr": "^0.1.5",
21
- "eslint-plugin-react-perf": "^3.3.0"
21
+ "eslint-plugin-react-perf": "^3.3.1"
22
22
  },
23
23
  "main": "./index.js",
24
24
  "types": "./index.d.ts",
@@ -10,7 +10,7 @@ module.exports = {
10
10
  'TSTypeParameterInstantiation',
11
11
  ],
12
12
  }],
13
- '@typescript-eslint/naming-convention': ['error', ...typescript_eslint_1.typescriptEslintNamingConvention()],
14
- 'unicorn/prevent-abbreviations': ['warn', unicorn_1.unicornPreventAbbreviations()],
13
+ '@typescript-eslint/naming-convention': ['error', ...(0, typescript_eslint_1.typescriptEslintNamingConvention)()],
14
+ 'unicorn/prevent-abbreviations': ['warn', (0, unicorn_1.unicornPreventAbbreviations)()],
15
15
  },
16
16
  };
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.typescriptEslintNamingConvention = void 0;
4
4
  const rules_1 = require("@perfective/eslint-config/rules");
5
5
  function typescriptEslintNamingConvention(extensions = []) {
6
- return rules_1.typescriptEslintNamingConvention([
6
+ return (0, rules_1.typescriptEslintNamingConvention)([
7
7
  {
8
8
  selector: ['variable'],
9
9
  modifiers: ['const'],
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unicornPreventAbbreviations = void 0;
4
4
  const rules_1 = require("@perfective/eslint-config/rules");
5
5
  function unicornPreventAbbreviations(replacements = {}, options = {}) {
6
- return rules_1.unicornPreventAbbreviations(Object.assign({ prop: false, props: false, ref: false, refs: false }, replacements), options);
6
+ return (0, rules_1.unicornPreventAbbreviations)(Object.assign({ prop: false, props: false, ref: false, refs: false }, replacements), options);
7
7
  }
8
8
  exports.unicornPreventAbbreviations = unicornPreventAbbreviations;
@@ -42,7 +42,10 @@ module.exports = {
42
42
  'react/no-access-state-in-setstate': 'error',
43
43
  'react/no-adjacent-inline-elements': 'error',
44
44
  'react/no-array-index-key': 'error',
45
- 'react/no-children-prop': 'error',
45
+ 'react/no-arrow-function-lifecycle': 'warn',
46
+ 'react/no-children-prop': ['error', {
47
+ allowFunctions: false,
48
+ }],
46
49
  'react/no-danger': 'error',
47
50
  'react/no-danger-with-children': 'error',
48
51
  'react/no-deprecated': 'error',
@@ -50,10 +53,12 @@ module.exports = {
50
53
  'react/no-did-update-set-state': ['error', 'disallow-in-func'],
51
54
  'react/no-direct-mutation-state': 'error',
52
55
  'react/no-find-dom-node': 'error',
56
+ 'react/no-invalid-html-attribute': 'warn',
53
57
  'react/no-is-mounted': 'error',
54
58
  'react/no-multi-comp': ['error', {
55
59
  ignoreStateless: false,
56
60
  }],
61
+ 'react/no-namespace': 'error',
57
62
  'react/no-redundant-should-component-update': 'error',
58
63
  'react/no-render-return-value': 'error',
59
64
  'react/no-set-state': 'off',
@@ -74,6 +79,7 @@ module.exports = {
74
79
  'react/no-unused-state': 'error',
75
80
  'react/no-will-update-set-state': ['error', 'disallow-in-func'],
76
81
  'react/prefer-es6-class': ['error', 'always'],
82
+ 'react/prefer-exact-props': 'off',
77
83
  'react/prefer-read-only-props': 'warn',
78
84
  'react/prefer-stateless-function': 'off',
79
85
  'react/prop-types': 'error',
@@ -76,17 +76,22 @@ module.exports = {
76
76
  'react/jsx-no-target-blank': ['warn', {
77
77
  allowReferrer: false,
78
78
  enforceDynamicLinks: 'always',
79
+ forms: true,
80
+ links: true,
79
81
  warnOnSpreadAttributes: true,
80
82
  }],
81
83
  'react/jsx-no-undef': ['error', {
82
84
  allowGlobals: false,
83
85
  }],
84
- 'react/jsx-no-useless-fragment': 'warn',
86
+ 'react/jsx-no-useless-fragment': ['warn', {
87
+ allowExpressions: true,
88
+ }],
85
89
  'react/jsx-one-expression-per-line': ['warn', {
86
90
  allow: 'single-child',
87
91
  }],
88
92
  'react/jsx-pascal-case': ['error', {
89
93
  allowAllCaps: false,
94
+ allowLeadingUnderscore: false,
90
95
  allowNamespace: false,
91
96
  ignore: [],
92
97
  }],
package/rules.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { cypressImportNoExtraneousDependencies, ImportNoExtraneousDependencies, importNoExtraneousDependencies, jestImportNoExtraneousDependencies, jsImportNoExtraneousDependencies, SimpleImportSortImports, simpleImportSortImports, TsLintRule, TsLintRules, TypescriptEslintNamingConvention, TypescriptEslintNamingConventionFormat, TypescriptEslintNamingConventionGroupSelector, TypescriptEslintNamingConventionIndividualSelector, TypescriptEslintNamingConventionSelector, TypescriptEslintNamingConventionUnderscore, TypescriptEslintTslintConfig, typescriptEslintTslintConfig, UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations } from '@perfective/eslint-config/rules';
2
- import { typescriptEslintNamingConvention } from './rules/eslint-config/rules/typescript-eslint';
3
- import { unicornPreventAbbreviations } from './rules/eslint-config/rules/unicorn';
4
- export { cypressImportNoExtraneousDependencies, ImportNoExtraneousDependencies, importNoExtraneousDependencies, jestImportNoExtraneousDependencies, jsImportNoExtraneousDependencies, SimpleImportSortImports, simpleImportSortImports, TsLintRule, TsLintRules, TypescriptEslintNamingConvention, typescriptEslintNamingConvention, TypescriptEslintNamingConventionFormat, TypescriptEslintNamingConventionGroupSelector, TypescriptEslintNamingConventionIndividualSelector, TypescriptEslintNamingConventionSelector, TypescriptEslintNamingConventionUnderscore, TypescriptEslintTslintConfig, typescriptEslintTslintConfig, UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations, unicornPreventAbbreviations, };
1
+ export { typescriptEslintNamingConvention } from './rules/eslint-config/rules/typescript-eslint';
2
+ export { unicornPreventAbbreviations } from './rules/eslint-config/rules/unicorn';
3
+ export { cypressImportNoExtraneousDependencies, ImportNoExtraneousDependencies, importNoExtraneousDependencies, jestImportNoExtraneousDependencies, jsImportNoExtraneousDependencies, SimpleImportSortImports, simpleImportSortImports, TsLintRule, TsLintRules, TypescriptEslintNamingConvention, TypescriptEslintNamingConventionFormat, TypescriptEslintNamingConventionGroupSelector, TypescriptEslintNamingConventionIndividualSelector, TypescriptEslintNamingConventionSelector, TypescriptEslintNamingConventionUnderscore, TypescriptEslintTslintConfig, typescriptEslintTslintConfig, UnicornPreventAbbreviationReplacements, UnicornPreventAbbreviations, } from '@perfective/eslint-config/rules';
package/rules.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unicornPreventAbbreviations = exports.typescriptEslintTslintConfig = exports.typescriptEslintNamingConvention = exports.simpleImportSortImports = exports.jsImportNoExtraneousDependencies = exports.jestImportNoExtraneousDependencies = exports.importNoExtraneousDependencies = exports.cypressImportNoExtraneousDependencies = void 0;
4
- const rules_1 = require("@perfective/eslint-config/rules");
3
+ exports.typescriptEslintTslintConfig = exports.simpleImportSortImports = exports.jsImportNoExtraneousDependencies = exports.jestImportNoExtraneousDependencies = exports.importNoExtraneousDependencies = exports.cypressImportNoExtraneousDependencies = exports.unicornPreventAbbreviations = exports.typescriptEslintNamingConvention = void 0;
4
+ var typescript_eslint_1 = require("./rules/eslint-config/rules/typescript-eslint");
5
+ Object.defineProperty(exports, "typescriptEslintNamingConvention", { enumerable: true, get: function () { return typescript_eslint_1.typescriptEslintNamingConvention; } });
6
+ var unicorn_1 = require("./rules/eslint-config/rules/unicorn");
7
+ Object.defineProperty(exports, "unicornPreventAbbreviations", { enumerable: true, get: function () { return unicorn_1.unicornPreventAbbreviations; } });
8
+ var rules_1 = require("@perfective/eslint-config/rules");
5
9
  Object.defineProperty(exports, "cypressImportNoExtraneousDependencies", { enumerable: true, get: function () { return rules_1.cypressImportNoExtraneousDependencies; } });
6
10
  Object.defineProperty(exports, "importNoExtraneousDependencies", { enumerable: true, get: function () { return rules_1.importNoExtraneousDependencies; } });
7
11
  Object.defineProperty(exports, "jestImportNoExtraneousDependencies", { enumerable: true, get: function () { return rules_1.jestImportNoExtraneousDependencies; } });
8
12
  Object.defineProperty(exports, "jsImportNoExtraneousDependencies", { enumerable: true, get: function () { return rules_1.jsImportNoExtraneousDependencies; } });
9
13
  Object.defineProperty(exports, "simpleImportSortImports", { enumerable: true, get: function () { return rules_1.simpleImportSortImports; } });
10
14
  Object.defineProperty(exports, "typescriptEslintTslintConfig", { enumerable: true, get: function () { return rules_1.typescriptEslintTslintConfig; } });
11
- const typescript_eslint_1 = require("./rules/eslint-config/rules/typescript-eslint");
12
- Object.defineProperty(exports, "typescriptEslintNamingConvention", { enumerable: true, get: function () { return typescript_eslint_1.typescriptEslintNamingConvention; } });
13
- const unicorn_1 = require("./rules/eslint-config/rules/unicorn");
14
- Object.defineProperty(exports, "unicornPreventAbbreviations", { enumerable: true, get: function () { return unicorn_1.unicornPreventAbbreviations; } });