@x4b/eslint-config 28.4.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.
Files changed (5) hide show
  1. package/base.js +42 -0
  2. package/index.js +20 -0
  3. package/package.json +33 -0
  4. package/remix.js +34 -0
  5. package/rules.js +46 -0
package/base.js ADDED
@@ -0,0 +1,42 @@
1
+ const rules = require('./rules');
2
+
3
+ module.exports = {
4
+ parser: '@typescript-eslint/parser',
5
+ parserOptions: {
6
+ ecmaVersion: 2020,
7
+ sourceType: 'module',
8
+ ecmaFeatures: {
9
+ jsx: true,
10
+ },
11
+ },
12
+ env: {
13
+ browser: true,
14
+ node: true,
15
+ es6: true,
16
+ jest: true,
17
+ },
18
+ settings: {
19
+ react: {
20
+ version: 'detect',
21
+ },
22
+ jest: {
23
+ version: 27,
24
+ },
25
+ },
26
+ rules: {
27
+ ...rules,
28
+ },
29
+ overrides: [
30
+ {
31
+ files: ['**/*.e2e.ts', '**/*.spec.ts', '**/*.e2e.tsx', '**/*.spec.tsx', '**/*.test.ts', '**/*.test.tsx'],
32
+ rules: {
33
+ 'sonarjs/no-duplicate-string': 'off',
34
+ 'sonarjs/no-identical-functions': 'off',
35
+ 'unicorn/no-useless-undefined': 'off',
36
+ '@typescript-eslint/no-non-null-assertion': 'off',
37
+ 'testing-library/render-result-naming-convention': 'error',
38
+ 'security/detect-non-literal-regexp': 'off',
39
+ },
40
+ },
41
+ ],
42
+ };
package/index.js ADDED
@@ -0,0 +1,20 @@
1
+ const base = require('./base');
2
+
3
+ module.exports = {
4
+ ...base,
5
+ plugins: ['@typescript-eslint', 'simple-import-sort', 'testing-library', 'jest-dom'],
6
+ extends: [
7
+ 'eslint:recommended',
8
+ 'plugin:@typescript-eslint/recommended',
9
+ 'plugin:react/recommended',
10
+ 'plugin:jsx-a11y/recommended',
11
+ 'plugin:prettier/recommended',
12
+ 'plugin:security/recommended',
13
+ 'plugin:react-hooks/recommended',
14
+ 'plugin:sonarjs/recommended',
15
+ 'plugin:unicorn/recommended',
16
+ 'plugin:testing-library/react',
17
+ 'plugin:jest-dom/recommended',
18
+ 'prettier',
19
+ ],
20
+ };
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@x4b/eslint-config",
3
+ "version": "28.4.0",
4
+ "main": "index.js",
5
+ "private": false,
6
+ "license": "MIT",
7
+ "dependencies": {
8
+ "@remix-run/eslint-config": "1.8.0",
9
+ "@typescript-eslint/eslint-plugin": "5.42.1",
10
+ "@typescript-eslint/parser": "5.42.1",
11
+ "eslint-config-prettier": "8.5.0",
12
+ "eslint-plugin-jest-dom": "4.0.2",
13
+ "eslint-plugin-jsx-a11y": "6.6.1",
14
+ "eslint-plugin-playwright": "^0.11.2",
15
+ "eslint-plugin-prettier": "4.2.1",
16
+ "eslint-plugin-react": "7.31.10",
17
+ "eslint-plugin-react-hooks": "4.6.0",
18
+ "eslint-plugin-security": "1.5.0",
19
+ "eslint-plugin-simple-import-sort": "8.0.0",
20
+ "eslint-plugin-sonarjs": "0.16.0",
21
+ "eslint-plugin-testing-library": "5.9.1",
22
+ "eslint-plugin-unicorn": "44.0.2"
23
+ },
24
+ "files": [
25
+ "index.js",
26
+ "base.js",
27
+ "rules.js",
28
+ "remix.js"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ }
33
+ }
package/remix.js ADDED
@@ -0,0 +1,34 @@
1
+ const base = require('./base');
2
+
3
+ module.exports = {
4
+ ...base,
5
+ plugins: ['simple-import-sort', 'testing-library', 'jest-dom'],
6
+ extends: [
7
+ '@remix-run/eslint-config',
8
+ '@remix-run/eslint-config/node',
9
+ 'eslint:recommended',
10
+ 'plugin:jsx-a11y/recommended',
11
+ 'plugin:prettier/recommended',
12
+ 'plugin:security/recommended',
13
+ 'plugin:sonarjs/recommended',
14
+ 'plugin:unicorn/recommended',
15
+ 'plugin:testing-library/react',
16
+ 'plugin:jest-dom/recommended',
17
+ 'prettier',
18
+ ],
19
+ overrides: [
20
+ {
21
+ files: ['e2e/**/*.test.ts', 'e2e/**/*.test.tsx'],
22
+ extends: ['plugin:playwright/playwright-test'],
23
+ rules: {
24
+ 'sonarjs/no-duplicate-string': 'off',
25
+ 'sonarjs/no-identical-functions': 'off',
26
+ 'unicorn/no-useless-undefined': 'off',
27
+ '@typescript-eslint/no-non-null-assertion': 'off',
28
+ 'testing-library/render-result-naming-convention': 'error',
29
+ 'security/detect-non-literal-regexp': 'off',
30
+ 'testing-library/prefer-screen-queries': 'off',
31
+ },
32
+ },
33
+ ],
34
+ };
package/rules.js ADDED
@@ -0,0 +1,46 @@
1
+ module.exports = {
2
+ 'no-console': ['error', { allow: ['warn', 'error', 'debug'] }],
3
+ 'no-extra-boolean-cast': 'off',
4
+ '@typescript-eslint/explicit-function-return-type': 'off',
5
+ '@typescript-eslint/explicit-member-accessibility': 'off',
6
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
7
+ '@typescript-eslint/ban-types': 'off',
8
+ '@typescript-eslint/no-var-requires': 'off',
9
+ '@typescript-eslint/no-empty-function': 'off',
10
+ 'unicorn/prevent-abbreviations': 'off',
11
+ 'react/jsx-uses-react': 'off',
12
+ 'react/react-in-jsx-scope': 'off',
13
+ 'react/prop-types': 'off',
14
+ 'react/display-name': 'off',
15
+ '@typescript-eslint/no-use-before-define': 'off',
16
+ 'security/detect-object-injection': 'off',
17
+ 'unicorn/filename-case': 'off',
18
+ 'unicorn/no-useless-undefined': ['error', { checkArguments: false }],
19
+ 'unicorn/no-array-reduce': 'off',
20
+ 'unicorn/prefer-object-from-entries': 'off',
21
+ 'unicorn/no-array-for-each': 'off',
22
+ 'unicorn/no-await-expression-member': 'off',
23
+ 'unicorn/consistent-function-scoping': 'off',
24
+ 'unicorn/text-encoding-identifier-case': 'off',
25
+ 'sonarjs/cognitive-complexity': ['error', 30],
26
+ 'sonarjs/no-nested-template-literals': 'off',
27
+ 'jsx-a11y/alt-text': 'off', // it's not smart enough...
28
+ 'unicorn/prefer-module': 'off',
29
+ 'unicorn/prefer-prototype-methods': 'off',
30
+ 'testing-library/render-result-naming-convention': 'off',
31
+ 'prettier/prettier': [
32
+ 'error',
33
+ {
34
+ endOfLine: 'auto',
35
+ },
36
+ ],
37
+ 'simple-import-sort/exports': 'error',
38
+ 'sonarjs/no-identical-expressions': 'off',
39
+ 'simple-import-sort/imports': [
40
+ 'error',
41
+ {
42
+ // The default grouping, but with no blank lines.
43
+ groups: [['^\\u0000', '^@?\\w', '^', '^\\.']],
44
+ },
45
+ ],
46
+ };