@boehringer-ingelheim/eslint-config 6.0.0-next.3 → 6.0.0-next.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/README.md +20 -0
- package/package.json +4 -2
- package/prettier-disable/index.js +14 -0
package/README.md
CHANGED
|
@@ -136,6 +136,26 @@ This shared ESLint configuration is designed to enforce best practices and recom
|
|
|
136
136
|
- [`playwright/prefer-to-have-length`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-have-length.md): enforces the use of `.toHaveLength()` instead of `.toEqual(n)` when testing the length of an object.
|
|
137
137
|
- [`playwright/require-top-level-describe`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-top-level-describe.md): requires tests to be organized into top-level `describe()` blocks.
|
|
138
138
|
|
|
139
|
+
### `@boehringer-ingelheim/eslint-config/prettier-disable`
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
module.exports = {
|
|
143
|
+
extends: [
|
|
144
|
+
'@boehringer-ingelheim/eslint-config/base/strict',
|
|
145
|
+
// Following needs eslint-plugin-prettier to be installed as described by https://github.com/prettier/eslint-plugin-prettier
|
|
146
|
+
// Should be second to last
|
|
147
|
+
'plugin:prettier/recommended',
|
|
148
|
+
// Should be last
|
|
149
|
+
'@boehringer-ingelheim/eslint-config/prettier-disable'
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
This shared ESLint configuration is wrapper around [`eslint-config-disable`](https://github.com/prettier/eslint-config-prettier), which is used to turn off all rules that are unnecessary or might conflict with Prettier. This wrapper reenables a few rules that can be used with our shared configurations as we are using specific options of those rules which are compatible with Prettier (see [Special Rules](https://github.com/prettier/eslint-config-prettier#special-rules)). Following rules are reenabled:
|
|
155
|
+
|
|
156
|
+
- [`curly`](https://github.com/eslint/eslint/blob/main/docs/src/rules/curly.md) with the (default) option "all": Enforce consistent brace style for all control statements
|
|
157
|
+
- [`no-confusing-arrow`](https://github.com/eslint/eslint/blob/main/docs/src/rules/no-confusing-arrow.md) with allowParens `false` and onlyOneSimpleParam `true`: Disallow arrow functions where they could be confused with comparisons.
|
|
158
|
+
|
|
139
159
|
## Local Development
|
|
140
160
|
|
|
141
161
|
### Install Dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boehringer-ingelheim/eslint-config",
|
|
3
|
-
"version": "6.0.0-next.
|
|
3
|
+
"version": "6.0.0-next.5",
|
|
4
4
|
"description": "Shared eslint configuration used at Boehringer Ingelheim for code styling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"boehringer",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"base",
|
|
18
18
|
"lib",
|
|
19
19
|
"react",
|
|
20
|
-
"playwright"
|
|
20
|
+
"playwright",
|
|
21
|
+
"prettier-disable"
|
|
21
22
|
],
|
|
22
23
|
"main": "base/index.js",
|
|
23
24
|
"scripts": {
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"@rushstack/eslint-patch": "^1.10.3",
|
|
34
35
|
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
35
36
|
"@typescript-eslint/parser": "^7.17.0",
|
|
37
|
+
"eslint-config-prettier": "^9.1.0",
|
|
36
38
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
37
39
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
38
40
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workaround to allow ESLint to resolve plugins that were installed
|
|
3
|
+
* by an external config, see https://github.com/eslint/eslint/issues/3458.
|
|
4
|
+
*/
|
|
5
|
+
require('@rushstack/eslint-patch/modern-module-resolution');
|
|
6
|
+
|
|
7
|
+
/** @type {import('eslint').ESLint.ConfigData & { parserOptions: import('eslint').ESLint.ConfigData['parserOptions'] & import('@typescript-eslint/parser').ParserOptions } } */
|
|
8
|
+
module.exports = {
|
|
9
|
+
extends: ['prettier'],
|
|
10
|
+
rules: {
|
|
11
|
+
curly: 'error',
|
|
12
|
+
'no-confusing-arrow': ['error', { allowParens: false, onlyOneSimpleParam: false }],
|
|
13
|
+
},
|
|
14
|
+
};
|