@interface-technologies/eslint-config 0.3.0 → 0.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 (2) hide show
  1. package/index.js +28 -20
  2. package/package.json +9 -14
package/index.js CHANGED
@@ -4,22 +4,26 @@ module.exports = {
4
4
  project: './tsconfig.json',
5
5
  tsconfigRootDir: '.',
6
6
  ecmaVersion: 2017,
7
- sourceType: 'module'
7
+ sourceType: 'module',
8
8
  },
9
9
  extends: [
10
10
  'airbnb',
11
11
  'airbnb-typescript',
12
12
  'airbnb/hooks',
13
13
  'plugin:promise/recommended',
14
+ 'plugin:jest/recommended',
15
+ 'plugin:testing-library/react',
14
16
  'plugin:@typescript-eslint/recommended',
15
17
  'plugin:@typescript-eslint/recommended-requiring-type-checking',
16
18
  'prettier',
17
19
  ],
18
- plugins: ['promise', '@typescript-eslint'],
20
+ plugins: ['promise', '@typescript-eslint', 'jest', 'testing-library'],
21
+ ignorePatterns: ['*.js', '*.cjs'],
19
22
  settings: {
20
23
  'import/resolver': {
21
- typescript: {}
22
- }
24
+ typescript: {},
25
+ },
26
+ 'testing-library/custom-renders': 'off',
23
27
  },
24
28
  rules: {
25
29
  'consistent-return': 'off',
@@ -32,22 +36,22 @@ module.exports = {
32
36
  'no-restricted-syntax': [
33
37
  'error',
34
38
  // Options from https://github.com/airbnb/javascript/blob/651280e5a22d08170187bea9a2b1697832c87ebc/packages/eslint-config-airbnb-base/rules/style.js
35
- // with for-of removed since TypeScript handles iterators in a smarter way than Babel
39
+ // with for-of removed
36
40
  {
37
41
  selector: 'ForInStatement',
38
42
  message:
39
- 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.'
43
+ 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
40
44
  },
41
45
  {
42
46
  selector: 'LabeledStatement',
43
47
  message:
44
- 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.'
48
+ 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
45
49
  },
46
50
  {
47
51
  selector: 'WithStatement',
48
52
  message:
49
- '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.'
50
- }
53
+ '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
54
+ },
51
55
  ],
52
56
  'no-shadow': 'off',
53
57
  'no-underscore-dangle': 'off',
@@ -56,23 +60,26 @@ module.exports = {
56
60
 
57
61
  '@typescript-eslint/explicit-function-return-type': [
58
62
  'warn',
59
- { allowExpressions: true }
63
+ { allowExpressions: true },
60
64
  ],
61
65
  '@typescript-eslint/no-non-null-assertion': 'off',
62
66
  '@typescript-eslint/no-shadow': 'off',
63
- "@typescript-eslint/no-use-before-define": ["error", { "functions": false, "classes": false }],
67
+ '@typescript-eslint/no-use-before-define': [
68
+ 'error',
69
+ { functions: false, classes: false },
70
+ ],
64
71
  '@typescript-eslint/unbound-method': 'off',
65
72
  '@typescript-eslint/naming-convention': [
66
73
  'error',
67
74
  {
68
75
  selector: 'variable',
69
76
  format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
70
- leadingUnderscore: 'allow'
77
+ leadingUnderscore: 'allow',
71
78
  },
72
79
  {
73
80
  selector: 'function',
74
81
  format: ['camelCase', 'PascalCase'],
75
- leadingUnderscore: 'allow'
82
+ leadingUnderscore: 'allow',
76
83
  },
77
84
  {
78
85
  selector: 'typeLike',
@@ -80,7 +87,6 @@ module.exports = {
80
87
  },
81
88
  ],
82
89
 
83
-
84
90
  // TypeScript already checks these things, see:
85
91
  // https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
86
92
  'import/named': 'off',
@@ -100,9 +106,9 @@ module.exports = {
100
106
  'ValidatedInput',
101
107
  'ValidatedAsyncSelect',
102
108
  'ValidatedSelect',
103
- 'ValidatedMultiSelect'
104
- ]
105
- }
109
+ 'ValidatedMultiSelect',
110
+ ],
111
+ },
106
112
  ],
107
113
 
108
114
  'react/destructuring-assignment': 'off',
@@ -115,7 +121,9 @@ module.exports = {
115
121
  'react/jsx-no-bind': 'off',
116
122
 
117
123
  // Unnecessary because of new JSX transform
118
- "react/jsx-uses-react": "off",
119
- "react/react-in-jsx-scope": "off"
120
- }
124
+ 'react/jsx-uses-react': 'off',
125
+ 'react/react-in-jsx-scope': 'off',
126
+
127
+ 'testing-library/no-node-access': 'off',
128
+ },
121
129
  }
package/package.json CHANGED
@@ -1,32 +1,27 @@
1
1
  {
2
2
  "name": "@interface-technologies/eslint-config",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "ESLint config for projects using TypeScript and React.",
5
- "homepage": "https://bitbucket.org/itidev/iti.react",
5
+ "homepage": "https://github.com/srmagura/iti-react",
6
6
  "license": "MIT",
7
7
  "author": {
8
8
  "name": "Interface Technologies, Inc."
9
9
  },
10
10
  "main": "index.js",
11
- "scripts": {
12
- "lint": "exit 0",
13
- "lint-staged": "exit 0",
14
- "test": "exit 0",
15
- "tsc": "exit 0",
16
- "tsc-test": "exit 0"
17
- },
18
11
  "peerDependencies": {
19
- "@typescript-eslint/eslint-plugin": ">=4.29.3",
20
- "@typescript-eslint/parser": ">=4.29.3",
12
+ "@typescript-eslint/eslint-plugin": ">=4.33.0",
13
+ "@typescript-eslint/parser": ">=4.33.0",
21
14
  "eslint": ">=7.32.0",
22
15
  "eslint-config-airbnb": "^18.2.1",
23
16
  "eslint-config-airbnb-typescript": "^14.0.0",
24
17
  "eslint-config-prettier": ">=8.3.0",
25
- "eslint-import-resolver-typescript": ">=2.4.0",
18
+ "eslint-import-resolver-typescript": ">=2.5.0",
26
19
  "eslint-plugin-import": ">=2.24.2",
20
+ "eslint-plugin-jest": ">=24.5.2",
27
21
  "eslint-plugin-jsx-a11y": ">=6.4.1",
28
22
  "eslint-plugin-promise": ">=5.1.0",
29
- "eslint-plugin-react": ">=7.24.0",
30
- "eslint-plugin-react-hooks": ">=4.2.0"
23
+ "eslint-plugin-react": ">=7.26.1",
24
+ "eslint-plugin-react-hooks": ">=4.2.0",
25
+ "eslint-plugin-testing-library": ">=4.12.4"
31
26
  }
32
27
  }