├── .editorconfig
├── .github
├── dependabot.yml
└── workflows
│ └── test-and-release.yml
├── .gitignore
├── .husky
└── pre-commit
├── .nvmrc
├── .prettierignore
├── .releaserc.json
├── .vscode
└── settings.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── base.js
├── configs.js
├── glob-patterns.js
├── jsdoc.js
├── node.js
├── options.js
├── package-lock.json
├── package.json
├── presets
├── typescript-node.js
├── typescript-react.js
└── typescript.js
├── prettier.config.js
├── react.js
├── styles
├── no-default-export.js
├── no-null.js
├── prefer-array-shorthand.js
├── prefer-arrow.js
├── prefer-interface.js
├── react-jsx-no-bind.js
└── react-jsx-no-literals.js
├── tests.js
├── tests
├── javascript
│ ├── .eslintrc.json
│ ├── babel.config.json
│ ├── main.js
│ ├── message.js
│ ├── test.json
│ └── webpack.config.js
├── node
│ ├── .eslintrc.json
│ ├── main.js
│ ├── message.js
│ └── package.json
├── react
│ ├── .eslintrc.json
│ ├── main.tsx
│ └── tsconfig.json
└── typescript
│ ├── .eslintrc.js
│ ├── main.ts
│ ├── message.ts
│ ├── test.json
│ ├── tsconfig.json
│ └── types.d.ts
└── typescript.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # This file is for unifying the coding style for different editors and IDEs.
2 | # More information at http://EditorConfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | charset = utf-8
8 | end_of_line = lf
9 | indent_size = 4
10 | indent_style = space
11 | insert_final_newline = true
12 | trim_trailing_whitespace = true
13 |
14 | # There are some usability issues with YAML files
15 | # if you don't use 2 spaces as indentation.
16 | [*.yml]
17 | indent_style = space
18 | indent_size = 2
19 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | # Enable version updates for npm
9 | - package-ecosystem: "npm"
10 | # Look for `package.json` and `lock` files in the `root` directory
11 | directory: "/"
12 | # Check the npm registry for updates every day (weekdays)
13 | schedule:
14 | interval: "weekly"
15 |
--------------------------------------------------------------------------------
/.github/workflows/test-and-release.yml:
--------------------------------------------------------------------------------
1 | name: 🧪 Test and 🚀 Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | - beta
8 | pull_request: {}
9 | workflow_dispatch: {}
10 |
11 | concurrency:
12 | group: ${{ github.ref }}
13 | cancel-in-progress: true
14 |
15 | jobs:
16 | test-and-release:
17 | runs-on: ubuntu-latest
18 | if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
19 |
20 | strategy:
21 | matrix:
22 | node-version: [18.x, 20.x]
23 |
24 | steps:
25 | - name: ⬇️ Checkout repo
26 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin@main
27 | - name: ⎔ Setup node
28 | uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # pin@main
29 | with:
30 | node-version: ${{ matrix.node-version }}
31 | cache: "npm"
32 | - name: 🗄 Cache node_modules
33 | id: cache-node_modules
34 | uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # pin@main
35 | with:
36 | path: "**/node_modules"
37 | key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
38 | - name: 📥 Install dependencies
39 | if: steps.cache-node_modules.outputs.cache-hit != 'true'
40 | run: |
41 | npm ci --ignore-scripts
42 | - name: 🧪 Test
43 | run: |
44 | npm test
45 | env:
46 | CI: true
47 | - name: 🚀 Release on npm
48 | if: ${{ contains(' refs/heads/main refs/heads/beta ', github.ref) && matrix.node-version == '20.x' }}
49 | env:
50 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 | run: |
53 | npm run release
54 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # node-waf configuration
20 | .lock-wscript
21 |
22 | # Compiled binary addons (http://nodejs.org/api/addons.html)
23 | build/Release
24 |
25 | # Dependency directory
26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27 | node_modules
28 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npx lint-staged
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v20.9.0
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | CHANGELOG.md
2 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "branches": ["main", { "name": "beta", "prerelease": true }],
3 | "plugins": [
4 | "@semantic-release/commit-analyzer",
5 | "@semantic-release/release-notes-generator",
6 | "@semantic-release/changelog",
7 | [
8 | "@semantic-release/git",
9 | {
10 | "assets": ["CHANGELOG.md"]
11 | }
12 | ],
13 | "@semantic-release/github",
14 | "@semantic-release/npm"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.defaultFormatter": "esbenp.prettier-vscode",
3 | "editor.formatOnSave": true,
4 | "editor.codeActionsOnSave": {
5 | "source.fixAll.eslint": "explicit"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # [40.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v39.2.0...v40.0.0) (2024-09-13)
2 |
3 |
4 | ### Features
5 |
6 | * Sort imports ([#172](https://github.com/peerigon/eslint-config-peerigon/issues/172)) ([0c1eb54](https://github.com/peerigon/eslint-config-peerigon/commit/0c1eb541ad6ab2d05e34b93622e73bb2c2d18c51))
7 |
8 |
9 | ### BREAKING CHANGES
10 |
11 | * Updated the prettier config to also sort imports.
12 |
13 | # [39.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v39.1.0...v39.2.0) (2024-07-20)
14 |
15 |
16 | ### Features
17 |
18 | * Update dependencies ([#165](https://github.com/peerigon/eslint-config-peerigon/issues/165)) ([80bd82b](https://github.com/peerigon/eslint-config-peerigon/commit/80bd82be3dc39de8ebc20f4828258db1f47813bf))
19 |
20 | # [39.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v39.0.1...v39.1.0) (2024-07-09)
21 |
22 |
23 | ### Features
24 |
25 | * Update dependencies ([#164](https://github.com/peerigon/eslint-config-peerigon/issues/164)) ([d598985](https://github.com/peerigon/eslint-config-peerigon/commit/d59898507ead60ddf923d6929acf690f70ab3cc9))
26 |
27 | ## [39.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v39.0.0...v39.0.1) (2024-04-29)
28 |
29 |
30 | ### Bug Fixes
31 |
32 | * Disable @trivago/prettier-plugin-sort-imports temporarily ([#142](https://github.com/peerigon/eslint-config-peerigon/issues/142)) ([501c74e](https://github.com/peerigon/eslint-config-peerigon/commit/501c74e86767cef936ac96bc2c9757eb4f3690ae))
33 |
34 | # [39.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v38.0.0...v39.0.0) (2024-03-22)
35 |
36 |
37 | ### Features
38 |
39 | * Replace deprecated eslint-plugin-node with eslint-plugin-n ([#119](https://github.com/peerigon/eslint-config-peerigon/issues/119)) ([f0d0521](https://github.com/peerigon/eslint-config-peerigon/commit/f0d05219a9fe7c209e124e90dfdd73715c14b029))
40 |
41 |
42 | ### BREAKING CHANGES
43 |
44 | * Since we switched from eslint-plugin-node to eslint-plugin-n, this may introduce new ESLint errors in Node projects.
45 |
46 | # [38.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v37.2.0...v38.0.0) (2024-03-22)
47 |
48 |
49 | ### chore
50 |
51 | * Update dependencies to latest versions ([#116](https://github.com/peerigon/eslint-config-peerigon/issues/116)) ([20ac5cb](https://github.com/peerigon/eslint-config-peerigon/commit/20ac5cb6ffb60af14acb80030bc4702430023b4e))
52 |
53 |
54 | ### BREAKING CHANGES
55 |
56 | * Update @typescript-eslint/eslint-plugin and
57 | @typescript-eslint/parser from 6.x to 7.x
58 |
59 | # [37.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v37.1.0...v37.2.0) (2024-03-22)
60 |
61 | ### Features
62 |
63 | - Add shared Prettier config for import sorting ([cb1ba16](https://github.com/peerigon/eslint-config-peerigon/commit/cb1ba1693351150f878aae17ef9dfa85aa83e0b7))
64 |
65 | # [37.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.2...v37.1.0) (2024-01-17)
66 |
67 | ### Features
68 |
69 | - Update dependencies ([06db8da](https://github.com/peerigon/eslint-config-peerigon/commit/06db8da283de98631f870229723425a43492b4f8))
70 |
71 | ## [37.0.2](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.1...v37.0.2) (2023-11-08)
72 |
73 | ### Bug Fixes
74 |
75 | - Relax logical-assignment-operators rule again ([38c984f](https://github.com/peerigon/eslint-config-peerigon/commit/38c984fddb988386f1313519db22ba4dd81c5f0c))
76 |
77 | ## [37.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.0...v37.0.1) (2023-11-08)
78 |
79 | ### Bug Fixes
80 |
81 | - Relax logical-assignment-operators rule ([25fe184](https://github.com/peerigon/eslint-config-peerigon/commit/25fe1847050f1e07a18aa746aa7025fe42a71f7a))
82 |
83 | # [37.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v36.0.0...v37.0.0) (2023-11-06)
84 |
85 | ### Features
86 |
87 | - Add new base rules ([#105](https://github.com/peerigon/eslint-config-peerigon/issues/105)) ([10d01ed](https://github.com/peerigon/eslint-config-peerigon/commit/10d01ed2b571608ae2f4c5cade8b8f6a1c0620ed))
88 | - New beta release ([c358189](https://github.com/peerigon/eslint-config-peerigon/commit/c3581892a2315cbb90b7aae4149604d78475fa64))
89 | - Remove deprecated formatting rules ([#103](https://github.com/peerigon/eslint-config-peerigon/issues/103)) ([deab90a](https://github.com/peerigon/eslint-config-peerigon/commit/deab90a769771931aaa866d31a6dd962722df766))
90 | - Remove special handling for Prettier ([#104](https://github.com/peerigon/eslint-config-peerigon/issues/104)) ([068b731](https://github.com/peerigon/eslint-config-peerigon/commit/068b731e2c62cfe68d86035e7d5506924a12e396))
91 |
92 | ### BREAKING CHANGES
93 |
94 | - Some new base rules have been introduced which might produce linting errors.
95 | - The `prettier-` prefix has been removed from all preset files: `peerigon/presets/prettier-typescript.js` becomes `peerigon/presets/typescript.js`, `peerigon/presets/prettier-typescript-react.js` becomes `peerigon/presets/typescript-react.js` and `peerigon/presets/prettier-typescript-node.js` becomes `peerigon/presets/typescript-node.js`
96 | - All formatting rules have been removed as they have been deprecated by ESLint (see eslint.org/blog/2023/10/deprecating-formatting-rules). We won't switch to @stylistic/eslint-plugin-js as code formatting should be done by Prettier nowadays.
97 |
98 | # [37.0.0-beta.4](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.0-beta.3...v37.0.0-beta.4) (2023-11-06)
99 |
100 | ### Features
101 |
102 | - New beta release ([c358189](https://github.com/peerigon/eslint-config-peerigon/commit/c3581892a2315cbb90b7aae4149604d78475fa64))
103 |
104 | # [37.0.0-beta.3](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.0-beta.2...v37.0.0-beta.3) (2023-11-06)
105 |
106 | ### Features
107 |
108 | - Add new base rules ([#105](https://github.com/peerigon/eslint-config-peerigon/issues/105)) ([10d01ed](https://github.com/peerigon/eslint-config-peerigon/commit/10d01ed2b571608ae2f4c5cade8b8f6a1c0620ed))
109 |
110 | ### BREAKING CHANGES
111 |
112 | - Some new base rules have been introduced which might produce linting errors.
113 |
114 | # [37.0.0-beta.2](https://github.com/peerigon/eslint-config-peerigon/compare/v37.0.0-beta.1...v37.0.0-beta.2) (2023-11-06)
115 |
116 | ### Features
117 |
118 | - Remove special handling for Prettier ([#104](https://github.com/peerigon/eslint-config-peerigon/issues/104)) ([068b731](https://github.com/peerigon/eslint-config-peerigon/commit/068b731e2c62cfe68d86035e7d5506924a12e396))
119 |
120 | ### BREAKING CHANGES
121 |
122 | - The `prettier-` prefix has been removed from all preset files: `peerigon/presets/prettier-typescript.js` becomes `peerigon/presets/typescript.js`, `peerigon/presets/prettier-typescript-react.js` becomes `peerigon/presets/typescript-react.js` and `peerigon/presets/prettier-typescript-node.js` becomes `peerigon/presets/typescript-node.js`
123 |
124 | # [37.0.0-beta.1](https://github.com/peerigon/eslint-config-peerigon/compare/v36.0.0...v37.0.0-beta.1) (2023-11-06)
125 |
126 | ### Features
127 |
128 | - Remove deprecated formatting rules ([#103](https://github.com/peerigon/eslint-config-peerigon/issues/103)) ([deab90a](https://github.com/peerigon/eslint-config-peerigon/commit/deab90a769771931aaa866d31a6dd962722df766))
129 |
130 | ### BREAKING CHANGES
131 |
132 | - All formatting rules have been removed as they have been deprecated by ESLint (see eslint.org/blog/2023/10/deprecating-formatting-rules). We won't switch to @stylistic/eslint-plugin-js as code formatting should be done by Prettier nowadays.
133 |
134 | # [36.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v35.0.0...v36.0.0) (2023-10-27)
135 |
136 | ### chore
137 |
138 | - Update dependencies ([5ffe402](https://github.com/peerigon/eslint-config-peerigon/commit/5ffe402784d2322143295bbc77f54b7effd65289))
139 |
140 | ### BREAKING CHANGES
141 |
142 | - Major version bumps of transitive dependencies @typescript-eslint/eslint-plugin, @typescript-eslint/parser and eslint-config-prettier
143 |
144 | # [35.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v34.0.0...v35.0.0) (2023-09-06)
145 |
146 | ### Features
147 |
148 | - **TypeScript:** Change parserOptions defaults for resolving tsconfig.json ([21aa03c](https://github.com/peerigon/eslint-config-peerigon/commit/21aa03cc29c49b55442c042d88870bc4ac013fce))
149 |
150 | ### BREAKING CHANGES
151 |
152 | - **TypeScript:** The parserOptions defaults for resolving tsconfig.json files have been changed to `project: true` (see also https://typescript-eslint.io/packages/parser/#project). This can be overridden in your ESLint config.
153 |
154 | # [34.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v33.3.0...v34.0.0) (2023-05-28)
155 |
156 | ### Features
157 |
158 | - Remove flowtype rules ([4d94b30](https://github.com/peerigon/eslint-config-peerigon/commit/4d94b30b3004ea1f4c8db6e399305365280be63c))
159 | - Remove Node 14 and 16 support ([715155c](https://github.com/peerigon/eslint-config-peerigon/commit/715155c55f92461692ac721e67cbbc2e10894454))
160 | - Remove old ES5 rules ([63494c6](https://github.com/peerigon/eslint-config-peerigon/commit/63494c6bdf7eea8198405dfa5ef869b75432eeff))
161 | - Update dependencies ([11bcc84](https://github.com/peerigon/eslint-config-peerigon/commit/11bcc84a28909a3e56050a043f578043ca610661))
162 |
163 | ### BREAKING CHANGES
164 |
165 | - We've removed official Node 14 and 16 support. We don't know of any breaking change though, so it may still work with older Node versions.
166 | - Removed old ES5 rules as they aren't used by any current projects anymore.
167 | - We've removed all rules related to FlowType as they haven't been maintained for quite a while.
168 |
169 | # [33.3.0](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.5...v33.3.0) (2022-05-04)
170 |
171 | ### Features
172 |
173 | - Relax lint rules in tests ([52e3f2e](https://github.com/peerigon/eslint-config-peerigon/commit/52e3f2e032f4105867c04dcf3ee65bfc0b3abff3))
174 |
175 | ## [33.2.5](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.4...v33.2.5) (2022-04-02)
176 |
177 | ### Bug Fixes
178 |
179 | - **TypeScript:** Relax @typescript-eslint/naming-convention ([36e61df](https://github.com/peerigon/eslint-config-peerigon/commit/36e61dfa1b4791253213043807f38da1916a119b))
180 |
181 | ## [33.2.4](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.3...v33.2.4) (2022-01-23)
182 |
183 | ### Bug Fixes
184 |
185 | - Update dependencies ([b95374e](https://github.com/peerigon/eslint-config-peerigon/commit/b95374e9068f4c6526f76691a0a837c829c0e338))
186 |
187 | ## [33.2.3](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.2...v33.2.3) (2022-01-23)
188 |
189 | ### Bug Fixes
190 |
191 | - Relax TypeScript rules for d.ts files ([ebbd53d](https://github.com/peerigon/eslint-config-peerigon/commit/ebbd53d96f19a5414eb6b70f19d947bfd13b9a9c))
192 |
193 | ## [33.2.2](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.1...v33.2.2) (2021-12-24)
194 |
195 | ### Bug Fixes
196 |
197 | - **TypeScript:** Disable import/no-default-export for d.ts files ([f6f0a2a](https://github.com/peerigon/eslint-config-peerigon/commit/f6f0a2afa77d96576f4913de204de73765508f1e))
198 |
199 | ## [33.2.1](https://github.com/peerigon/eslint-config-peerigon/compare/v33.2.0...v33.2.1) (2021-12-22)
200 |
201 | ### Bug Fixes
202 |
203 | - **TypeScript:** Disable "@typescript-eslint/no-unsafe-argument" ([8022f7e](https://github.com/peerigon/eslint-config-peerigon/commit/8022f7e35c5dcfb05352b6dbdfd3a6e279fc364f))
204 |
205 | # [33.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v33.1.0...v33.2.0) (2021-12-14)
206 |
207 | ### Features
208 |
209 | - Update dependencies ([fdd44c6](https://github.com/peerigon/eslint-config-peerigon/commit/fdd44c6062ff1fe19921b15405845b85943d71b2))
210 |
211 | # [33.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v33.0.1...v33.1.0) (2021-12-14)
212 |
213 | ### Features
214 |
215 | - Disable import/no-anonymous-default-export in config files ([e5f05c1](https://github.com/peerigon/eslint-config-peerigon/commit/e5f05c1e23aa039a6dcfdbd81f1d0029ee6fd534))
216 |
217 | ## [33.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v33.0.0...v33.0.1) (2021-12-06)
218 |
219 | ### Bug Fixes
220 |
221 | - Disable "no-lonely-if" ([08200d2](https://github.com/peerigon/eslint-config-peerigon/commit/08200d202ed5699b78a8838c1ad8edb14c9635ad))
222 |
223 | # [33.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v32.0.1...v33.0.0) (2021-11-12)
224 |
225 | ### Features
226 |
227 | - **react:** Add support for new JSX transformer ([07c01a0](https://github.com/peerigon/eslint-config-peerigon/commit/07c01a0543c3588e2c36789147ce2d4cc10a2627))
228 | - **typescript:** Simplify typescript setup ([763644a](https://github.com/peerigon/eslint-config-peerigon/commit/763644ae1d0750dc52e569e49bf23af984e024cf))
229 |
230 | ### BREAKING CHANGES
231 |
232 | - **typescript:** The tsconfig.json path is not relative to the CWD now, but to your package.json. In most cases you don't need to change anything. If your tsconfig.json is not next to your package.json, you need to specify parserOptions.project as described in the README.
233 | - **react:** This assumes that you're using at least React 17. In React 16, things will break if you omit the React import. See also https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
234 |
235 | ## [32.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v32.0.0...v32.0.1) (2021-11-12)
236 |
237 | ### Bug Fixes
238 |
239 | - Switch parser ecmaVersion to "latest" ([a08dde8](https://github.com/peerigon/eslint-config-peerigon/commit/a08dde874d1aebd2111d5e71c1c05eba947aeded))
240 |
241 | # [32.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v31.0.3...v32.0.0) (2021-11-05)
242 |
243 | ### Features
244 |
245 | - Add support for ESLint 8.x ([#96](https://github.com/peerigon/eslint-config-peerigon/issues/96)) ([8d43d6d](https://github.com/peerigon/eslint-config-peerigon/commit/8d43d6deaa8dbc7107f9059924cf1d134c1da805))
246 |
247 | ### BREAKING CHANGES
248 |
249 | - ESLint >= 8.1.0 and Node >= 14.0.0 is required now
250 |
251 | ## [31.0.3](https://github.com/peerigon/eslint-config-peerigon/compare/v31.0.2...v31.0.3) (2021-09-16)
252 |
253 | ### Bug Fixes
254 |
255 | - Disable no-loop-func ([be1b0f4](https://github.com/peerigon/eslint-config-peerigon/commit/be1b0f4aaa5187acbeaf3bfcb2bd7e909e3a9a82))
256 |
257 | ## [31.0.2](https://github.com/peerigon/eslint-config-peerigon/compare/v31.0.1...v31.0.2) (2021-08-22)
258 |
259 | ### Bug Fixes
260 |
261 | - **typescript:** Disable "@babel/new-cap" for TypeScript projects ([aa363af](https://github.com/peerigon/eslint-config-peerigon/commit/aa363af0fd84f0e990742790803db0ddc9c7f16e))
262 |
263 | ## [31.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v31.0.0...v31.0.1) (2021-08-02)
264 |
265 | ### Bug Fixes
266 |
267 | - **TypeScript:** Disable `@typescript-eslint/method-signature-style` for `d.ts` files ([87e915b](https://github.com/peerigon/eslint-config-peerigon/commit/87e915b75fc84ca729ac3ac38efa38cd1a4cbadb))
268 |
269 | # [31.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v30.2.0...v31.0.0) (2021-07-28)
270 |
271 | ### Features
272 |
273 | - Enable `import/no-import-module-exports` ([d4be1ce](https://github.com/peerigon/eslint-config-peerigon/commit/d4be1ce1fc354422f3e721555a0cd8b1db0253a4))
274 | - Enable `import/no-relative-packages` ([b44fd1c](https://github.com/peerigon/eslint-config-peerigon/commit/b44fd1cf4c92103bbcbc86d4a9cce9629f092e00))
275 |
276 | ### BREAKING CHANGES
277 |
278 | - Prevent relative package imports in Yarn/Lerna workspaces. See https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md
279 | - import and module.exports should not be mixed. See https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md
280 |
281 | # [30.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v30.1.0...v30.2.0) (2021-07-28)
282 |
283 | ### Bug Fixes
284 |
285 | - **styles/prefer-arrow:** Allow class methods again ([6c7b1b8](https://github.com/peerigon/eslint-config-peerigon/commit/6c7b1b855693212b40d3c18093fc699ff0c73d82))
286 |
287 | ### Features
288 |
289 | - **typescript:** Relax "@typescript-eslint/no-unused-vars" in d.ts files ([561b939](https://github.com/peerigon/eslint-config-peerigon/commit/561b939c01f55ac5d425f64ecdf3dfe1035a5f65))
290 |
291 | # [30.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v30.0.2...v30.1.0) (2021-05-07)
292 |
293 | ### Features
294 |
295 | - Relax "no-constant-condition" for loops ([7337bb7](https://github.com/peerigon/eslint-config-peerigon/commit/7337bb70d14c7ea01ebb10f02ab9fdbb9cf7b3de))
296 |
297 | ## [30.0.2](https://github.com/peerigon/eslint-config-peerigon/compare/v30.0.1...v30.0.2) (2021-03-05)
298 |
299 | ### Bug Fixes
300 |
301 | - Problem with prettier/react ([dcbd28f](https://github.com/peerigon/eslint-config-peerigon/commit/dcbd28fbc45f409c1c24a7abae5abde383fc2036))
302 |
303 | ## [30.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v30.0.0...v30.0.1) (2021-03-05)
304 |
305 | ### Bug Fixes
306 |
307 | - Problem with updated eslint-config-prettier ([3108084](https://github.com/peerigon/eslint-config-peerigon/commit/3108084d43c8cadd27d3714229f90a4fee7df251))
308 |
309 | # [30.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v29.0.0...v30.0.0) (2021-01-31)
310 |
311 | ### chore
312 |
313 | - Update dependencies ([#91](https://github.com/peerigon/eslint-config-peerigon/issues/91)) ([371ec42](https://github.com/peerigon/eslint-config-peerigon/commit/371ec4294808a48a92d9c8d625d40b8c5feae0e5)), closes [#89](https://github.com/peerigon/eslint-config-peerigon/issues/89)
314 |
315 | ### BREAKING CHANGES
316 |
317 | - We switched to @babel/eslint-parser and @babel/eslint-plugin, see https://babel.dev/blog/2020/07/13/the-state-of-babel-eslint . If you're using Babel you should set [`requireConfigFile: true`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser#additional-parser-configuration) in your ESLint config. ESLint will then use your `babel.config.json`.
318 | - You can remove TypeScript-specific ESLint dependencies, especially `@typescript-eslint/parser`. They should ship with the config.
319 |
320 | # [30.0.0-beta.1](https://github.com/peerigon/eslint-config-peerigon/compare/v29.0.0...v30.0.0-beta.1) (2021-01-31)
321 |
322 | ### chore
323 |
324 | - Update dependencies ([a957c21](https://github.com/peerigon/eslint-config-peerigon/commit/a957c211fb5302dd6a7d126c7d5d7be1ed1f0477))
325 |
326 | ### BREAKING CHANGES
327 |
328 | - You should have @babel/core as your project dependency now, see https://babel.dev/blog/2020/07/13/the-state-of-babel-eslint#the-present
329 | - You can remove TypeScript-specific ESLint dependencies, especially @typescript-eslint/parser. They should ship with the config.
330 |
331 | # [29.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.5...v29.0.0) (2021-01-31)
332 |
333 | ### Bug Fixes
334 |
335 | - **JavaScript:** Remove deprecated rules ([eb52883](https://github.com/peerigon/eslint-config-peerigon/commit/eb528832d9d38289d8bc3a6bc34dea78d6023ee2))
336 |
337 | ### chore
338 |
339 | - Update dependencies ([44e21b5](https://github.com/peerigon/eslint-config-peerigon/commit/44e21b5ab59783af869e93eb5d5e1a0e0f5802a0))
340 |
341 | ### Features
342 |
343 | - Add prettier-typescript-node preset ([1464581](https://github.com/peerigon/eslint-config-peerigon/commit/1464581a8ec2cdf5e2479078125e283004d5d0dd))
344 | - **JavaScript:** Add "no-loss-of-precision" rule as warning ([5fd2828](https://github.com/peerigon/eslint-config-peerigon/commit/5fd2828c9489d3bf9a332aed358432bba7cd87b9))
345 | - **JavaScript:** Add "no-nonoctal-decimal-escape" rule as warning ([92e7aa9](https://github.com/peerigon/eslint-config-peerigon/commit/92e7aa9aaf7e71e3e97b7cfe7c46d7327635af20))
346 | - **JavaScript:** Add "no-promise-executor-return" rule as warning ([a679f6b](https://github.com/peerigon/eslint-config-peerigon/commit/a679f6bb22e99ce78f82c858c048e4ab00560db3))
347 | - **JavaScript:** Add "no-restricted-exports" rule as warning ([c1f3852](https://github.com/peerigon/eslint-config-peerigon/commit/c1f3852956f5ba4fbdfd58dbc32760d407a0f930))
348 | - **JavaScript:** Add "no-unreachable-loop" rule as warning ([5757b4b](https://github.com/peerigon/eslint-config-peerigon/commit/5757b4b43240905ee839a6910f19eab6f5f01728))
349 | - **JavaScript:** Add "no-unsafe-optional-chaining" rule as warning ([eb77e91](https://github.com/peerigon/eslint-config-peerigon/commit/eb77e91768039ffd9f83eef8c63638cec94c7094))
350 | - **JavaScript:** Add "no-useless-backreference" rule as warning ([1653191](https://github.com/peerigon/eslint-config-peerigon/commit/165319178dc5cd82b44bad9228a1f751e7493960))
351 | - **node:** Use eslint-plugin-node ([75c2ffe](https://github.com/peerigon/eslint-config-peerigon/commit/75c2ffe0d2d2fa68ae316ad8bc97964d2c0c0645))
352 | - **TypeScript:** Add new TypeScript rules ([199a393](https://github.com/peerigon/eslint-config-peerigon/commit/199a393e400d4c6d9ef873db28a59e5ee30730d4))
353 |
354 | ### BREAKING CHANGES
355 |
356 | - **node:** We switched to eslint-plugin-node and their recommended rules
357 | - Change `eslint` peer dependency to `^7.15.0`
358 | - Update `eslint-config-prettier` to `^7.2.0`
359 |
360 | # [29.0.0-beta.1](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.5...v29.0.0-beta.1) (2021-01-31)
361 |
362 | ### Bug Fixes
363 |
364 | - **JavaScript:** Remove deprecated rules ([eb52883](https://github.com/peerigon/eslint-config-peerigon/commit/eb528832d9d38289d8bc3a6bc34dea78d6023ee2))
365 |
366 | ### chore
367 |
368 | - Update dependencies ([44e21b5](https://github.com/peerigon/eslint-config-peerigon/commit/44e21b5ab59783af869e93eb5d5e1a0e0f5802a0))
369 |
370 | ### Features
371 |
372 | - Add prettier-typescript-node preset ([1464581](https://github.com/peerigon/eslint-config-peerigon/commit/1464581a8ec2cdf5e2479078125e283004d5d0dd))
373 | - **JavaScript:** Add "no-loss-of-precision" rule as warning ([5fd2828](https://github.com/peerigon/eslint-config-peerigon/commit/5fd2828c9489d3bf9a332aed358432bba7cd87b9))
374 | - **JavaScript:** Add "no-nonoctal-decimal-escape" rule as warning ([92e7aa9](https://github.com/peerigon/eslint-config-peerigon/commit/92e7aa9aaf7e71e3e97b7cfe7c46d7327635af20))
375 | - **JavaScript:** Add "no-promise-executor-return" rule as warning ([a679f6b](https://github.com/peerigon/eslint-config-peerigon/commit/a679f6bb22e99ce78f82c858c048e4ab00560db3))
376 | - **JavaScript:** Add "no-restricted-exports" rule as warning ([c1f3852](https://github.com/peerigon/eslint-config-peerigon/commit/c1f3852956f5ba4fbdfd58dbc32760d407a0f930))
377 | - **JavaScript:** Add "no-unreachable-loop" rule as warning ([5757b4b](https://github.com/peerigon/eslint-config-peerigon/commit/5757b4b43240905ee839a6910f19eab6f5f01728))
378 | - **JavaScript:** Add "no-unsafe-optional-chaining" rule as warning ([eb77e91](https://github.com/peerigon/eslint-config-peerigon/commit/eb77e91768039ffd9f83eef8c63638cec94c7094))
379 | - **JavaScript:** Add "no-useless-backreference" rule as warning ([1653191](https://github.com/peerigon/eslint-config-peerigon/commit/165319178dc5cd82b44bad9228a1f751e7493960))
380 | - **node:** Use eslint-plugin-node ([75c2ffe](https://github.com/peerigon/eslint-config-peerigon/commit/75c2ffe0d2d2fa68ae316ad8bc97964d2c0c0645))
381 | - **TypeScript:** Add new TypeScript rules ([199a393](https://github.com/peerigon/eslint-config-peerigon/commit/199a393e400d4c6d9ef873db28a59e5ee30730d4))
382 |
383 | ### BREAKING CHANGES
384 |
385 | - **node:** We switched to eslint-plugin-node and their recommended rules
386 | - Change `eslint` peer dependency to `^7.15.0`
387 | - Update `eslint-config-prettier` to `^7.2.0`
388 |
389 | ## [28.1.5](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.4...v28.1.5) (2020-11-30)
390 |
391 | ### Bug Fixes
392 |
393 | - **TypeScript:** Disable @typescript-eslint/no-throw-literal ([1b8aa70](https://github.com/peerigon/eslint-config-peerigon/commit/1b8aa70555ab625ed4aca7b288bd223ee74d8b1f))
394 |
395 | ## [28.1.4](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.3...v28.1.4) (2020-07-16)
396 |
397 | ### Bug Fixes
398 |
399 | - **typescript:** Disable @typescript-eslint/consistent-type-assertions in tests ([938a733](https://github.com/peerigon/eslint-config-peerigon/commit/938a73396dfb687704a8885d128f59ae4866ae5a))
400 | - **typescript:** Disable @typescript-eslint/no-unsafe-call ([60fd344](https://github.com/peerigon/eslint-config-peerigon/commit/60fd34420829afea96f71c888147dcb88bf7e970))
401 |
402 | ## [28.1.3](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.2...v28.1.3) (2020-07-09)
403 |
404 | ### Bug Fixes
405 |
406 | - **base:** Disable accessor-pairs ([e9ca31d](https://github.com/peerigon/eslint-config-peerigon/commit/e9ca31dc264f3834764d50886f769df33a8e86c3))
407 |
408 | ## [28.1.2](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.1...v28.1.2) (2020-07-09)
409 |
410 | ### Bug Fixes
411 |
412 | - Missing preset files in published package ([0b79df1](https://github.com/peerigon/eslint-config-peerigon/commit/0b79df1404e48777bb91af739d4fde496092e961))
413 |
414 | ## [28.1.1](https://github.com/peerigon/eslint-config-peerigon/compare/v28.1.0...v28.1.1) (2020-07-09)
415 |
416 | ### Bug Fixes
417 |
418 | - **base:** Disable import/no-unassigned-import ([3ccf48a](https://github.com/peerigon/eslint-config-peerigon/commit/3ccf48acc02c0c6aad0343561c63aafb588c5e57))
419 | - **typescript:** Disable @typescript-eslint/no-unsafe-return in tests ([4ef74ab](https://github.com/peerigon/eslint-config-peerigon/commit/4ef74aba0803911d4fda4da5d2355cd07edb8889))
420 |
421 | # [28.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v28.0.0...v28.1.0) (2020-07-09)
422 |
423 | ### Bug Fixes
424 |
425 | - **typescript:** Relax rules that forbid the reassignment of 'any' ([93bc5ca](https://github.com/peerigon/eslint-config-peerigon/commit/93bc5ca8ec7e909a6a4afab77adedfaae9656bcd))
426 | - **typescript:** Remove additional @typescript-eslint/no-unnecessary-condition options ([033011a](https://github.com/peerigon/eslint-config-peerigon/commit/033011a356902847f184f895bfff6472b4e10665))
427 | - **typescript:** Remove deprecated rules ([d4f0048](https://github.com/peerigon/eslint-config-peerigon/commit/d4f00484e5867ec940ba1f76979b354f61af4269))
428 |
429 | ### Features
430 |
431 | - Add presets for a quick start ([326052d](https://github.com/peerigon/eslint-config-peerigon/commit/326052d92d04d7414b9d973c6df71af8aeda1c97))
432 | - **typescript:** Allow ts-expect-error with description ([b80c6a5](https://github.com/peerigon/eslint-config-peerigon/commit/b80c6a53aae14324a1006f859b329c6a155b3422))
433 | - **typescript:** Disable @typescript-eslint/no-explicit-any ([5332eb1](https://github.com/peerigon/eslint-config-peerigon/commit/5332eb184b5ab6e6cb9314c26d5d81f48a0ee0a5))
434 | - **typescript:** Disable @typescript-eslint/no-non-null-assertion ([94b79dd](https://github.com/peerigon/eslint-config-peerigon/commit/94b79ddc81bb3aaed7e3eae3765c246c070ff633))
435 |
436 | # [28.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.8.0...v28.0.0) (2020-05-16)
437 |
438 | ### Features
439 |
440 | - Remove Prettier configuration ([e6c0d39](https://github.com/peerigon/eslint-config-peerigon/commit/e6c0d393f2de987e7ad33198085b2173ea9a9cd3))
441 |
442 | ### BREAKING CHANGES
443 |
444 | - Based on discussion https://github.com/peerigon/eslint-config-peerigon/issues/76 we decided to remove our Prettier configuration.
445 | In order to avoid useless discussions, people should format their code with thatever style Prettier uses. Configuring Prettier ultimately defeats the purpose of Prettier, see https://github.com/prettier/prettier/issues/40
446 |
447 | # [27.8.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.7.0...v27.8.0) (2020-05-16)
448 |
449 | ### Features
450 |
451 | - Move jsdoc rules to separate config ([c810d1f](https://github.com/peerigon/eslint-config-peerigon/commit/c810d1f969e96ce51907a619109f9e75d4ef5733)), closes [#87](https://github.com/peerigon/eslint-config-peerigon/issues/87)
452 |
453 | # [27.7.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.6.1...v27.7.0) (2020-05-16)
454 |
455 | ### Features
456 |
457 | - Increase eslint peerDependency to 7.0.0 ([45d5003](https://github.com/peerigon/eslint-config-peerigon/commit/45d5003b8ff2681b114d9ce370be5e903409da41))
458 |
459 | ## [27.6.1](https://github.com/peerigon/eslint-config-peerigon/compare/v27.6.0...v27.6.1) (2020-05-13)
460 |
461 | ### Bug Fixes
462 |
463 | - Disable class-methods-use-this in react rules ([a0fe36b](https://github.com/peerigon/eslint-config-peerigon/commit/a0fe36bf9578e76ef94e60a99d96f2683c512b73))
464 |
465 | # [27.6.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.5.2...v27.6.0) (2020-03-23)
466 |
467 | ### Features
468 |
469 | - **typescript:** Disable @typescript-eslint/prefer-regexp-exec ([f170b8a](https://github.com/peerigon/eslint-config-peerigon/commit/f170b8ae8ab316271fccceda7eb06f70cb4bc39d))
470 |
471 | ## [27.5.2](https://github.com/peerigon/eslint-config-peerigon/compare/v27.5.1...v27.5.2) (2020-03-23)
472 |
473 | ### Bug Fixes
474 |
475 | - Fix security issues found by npm audit ([6501094](https://github.com/peerigon/eslint-config-peerigon/commit/6501094f33261e72db96a77c3ecbcae0936a3749))
476 |
477 | ## [27.5.1](https://github.com/peerigon/eslint-config-peerigon/compare/v27.5.0...v27.5.1) (2020-03-23)
478 |
479 | ### Bug Fixes
480 |
481 | - **base:** Disable no-eq-null ([df9922f](https://github.com/peerigon/eslint-config-peerigon/commit/df9922f99a948c54afccc0fe40ba1972502fe821))
482 |
483 | # [27.5.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.4.0...v27.5.0) (2020-03-09)
484 |
485 | ### Features
486 |
487 | - **typescript:** Improve @typescript-eslint/naming-convention ([#85](https://github.com/peerigon/eslint-config-peerigon/issues/85)) ([86299ff](https://github.com/peerigon/eslint-config-peerigon/commit/86299fff66f6f26597ef7a82453bc2a70810a458))
488 |
489 | # [27.4.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.3.0...v27.4.0) (2020-03-09)
490 |
491 | ### Features
492 |
493 | - Disable "class-methods-use-this" ([f8f03c0](https://github.com/peerigon/eslint-config-peerigon/commit/f8f03c0bf9800d140d44ecdb356c348ccd2f3846))
494 |
495 | # [27.3.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.2.0...v27.3.0) (2020-03-09)
496 |
497 | ### Features
498 |
499 | - Disable "no-warning-comments" ([460f385](https://github.com/peerigon/eslint-config-peerigon/commit/460f385324d3cd17c1826b1da3cf40aef0035785))
500 |
501 | # [27.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.1.3...v27.2.0) (2020-03-05)
502 |
503 | ### Bug Fixes
504 |
505 | - Disable "no-anonymous-default-exports" rule in tests ([#82](https://github.com/peerigon/eslint-config-peerigon/issues/82)) ([01f4cd4](https://github.com/peerigon/eslint-config-peerigon/commit/01f4cd48a1feb811ddd4c33b853e9736a20d350a))
506 |
507 | ### Features
508 |
509 | - Add prefer array shorthand style option ([#81](https://github.com/peerigon/eslint-config-peerigon/issues/81)) ([fb9f50a](https://github.com/peerigon/eslint-config-peerigon/commit/fb9f50aa7f69cd74306b784fb30f3750dfccb818))
510 |
511 | ## [27.1.3](https://github.com/peerigon/eslint-config-peerigon/compare/v27.1.2...v27.1.3) (2020-02-13)
512 |
513 | ### Bug Fixes
514 |
515 | - **base:** Relax some promise rules ([8b357e1](https://github.com/peerigon/eslint-config-peerigon/commit/8b357e1a16f583ba68a980ef27666ab18bcba599))
516 | - **react:** Fix minor issue when using styles/react-jsx-no-literals ([049cac6](https://github.com/peerigon/eslint-config-peerigon/commit/049cac6997c59f6c093b750700cb72e636c0f7e1))
517 | - **typescript:** Disable @typescript-eslint/restrict-template-expressions ([efbb8b3](https://github.com/peerigon/eslint-config-peerigon/commit/efbb8b3728aad709b0a9d3f3461de369cf0bd8c6))
518 |
519 | ## [27.1.2](https://github.com/peerigon/eslint-config-peerigon/compare/v27.1.1...v27.1.2) (2020-02-13)
520 |
521 | ### Bug Fixes
522 |
523 | - **typescript:** Disable @typescript-eslint/require-array-sort-compare ([e6ac2e1](https://github.com/peerigon/eslint-config-peerigon/commit/e6ac2e1b9015504ba3dd3dcf79cb8234fbbe7a5c))
524 |
525 | ## [27.1.1](https://github.com/peerigon/eslint-config-peerigon/compare/v27.1.0...v27.1.1) (2020-02-13)
526 |
527 | ### Bug Fixes
528 |
529 | - **react:** Fix problem with escape hatch in styles/react-jsx-no-literals ([993568b](https://github.com/peerigon/eslint-config-peerigon/commit/993568b6884b068407e01443d8551be4467dc8d6))
530 |
531 | # [27.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v27.0.1...v27.1.0) (2020-02-13)
532 |
533 | ### Features
534 |
535 | - **typescript:** Disable no-extraneous-class ([c4f49eb](https://github.com/peerigon/eslint-config-peerigon/commit/c4f49eb6a8b752322adb299b568d28526087ae0d))
536 | - Allow exceptions for naming conventions in TypeScript projects ([89de83b](https://github.com/peerigon/eslint-config-peerigon/commit/89de83bc54a1809de6e0a0ec7bb20cc3e0a41067))
537 |
538 | ## [27.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v27.0.0...v27.0.1) (2020-02-12)
539 |
540 | ### Bug Fixes
541 |
542 | - Add new example `.editorconfig` ([5891b4c](https://github.com/peerigon/eslint-config-peerigon/commit/5891b4c78b2a0007d393dd3490d350c4d8c700a5))
543 |
544 | # [27.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v26.0.0...v27.0.0) (2020-02-12)
545 |
546 | ### Bug Fixes
547 |
548 | - **typescript:** Do not set tsconfig.json by default ([6b35fd4](https://github.com/peerigon/eslint-config-peerigon/commit/6b35fd420d98ae9b6837fabdb5c88d13ec1254fa))
549 |
550 | ### BREAKING CHANGES
551 |
552 | - **typescript:** We don't set the tsconfig.json now by default. Every project needs to specify it explicitly. This prevents some bugs that would be otherwise hard to understand. We also added a note to the README which should help people to set it up.
553 |
554 | # [26.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v25.3.1...v26.0.0) (2020-02-12)
555 |
556 | ### Bug Fixes
557 |
558 | - Remove impractical rules ([56c62a2](https://github.com/peerigon/eslint-config-peerigon/commit/56c62a26a112924548d11237ed9ae4c7d5411b9c))
559 | - **base:** Disable require-atomic-updates ([38cd859](https://github.com/peerigon/eslint-config-peerigon/commit/38cd859fcf112c13469fba95822549d9808e1ae0))
560 | - **base:** Improve padding-line-between-statements ([4b3c394](https://github.com/peerigon/eslint-config-peerigon/commit/4b3c39469b76094ff3557ac8fdde5634b49360b5))
561 | - **base:** Increase soft limit of complexity rule ([a78a702](https://github.com/peerigon/eslint-config-peerigon/commit/a78a702f5b5d16ff9b11237ee9c059618f80eb32))
562 | - **base:** Temporarily disable require-unicode-regexp ([b248df7](https://github.com/peerigon/eslint-config-peerigon/commit/b248df7736fd7a4ccf7914a418c46cd533ec052a))
563 | - **typescript:** Allow \_ parameter names ([c0b3779](https://github.com/peerigon/eslint-config-peerigon/commit/c0b37797012dbea18efa45c6989ec78bfe694f99))
564 | - **typescript:** Only require return await inside try-catch ([709751f](https://github.com/peerigon/eslint-config-peerigon/commit/709751fa7b49c507c2a8112d8625710bc71510a6))
565 | - **typescript:** Switch to regular camelCase and PascalCase naming convention ([182c295](https://github.com/peerigon/eslint-config-peerigon/commit/182c29553f8c021c776d66dbd15dbe9f09c91e3e))
566 | - Disable no-return-await ([14db3eb](https://github.com/peerigon/eslint-config-peerigon/commit/14db3eb268b4ffd1923958fb1952248ae77dbbec))
567 | - Fine-tune soft limits of max-lines and max-dependencies ([a123f41](https://github.com/peerigon/eslint-config-peerigon/commit/a123f41676aad7b3d56ff35512774fd4860093d9))
568 |
569 | ### chore
570 |
571 | - Refactor glob-patterns module ([1db1f22](https://github.com/peerigon/eslint-config-peerigon/commit/1db1f22dedf8a9d1c6cc7342391f3774288e93dc))
572 | - Remove support for Node<10 ([6c45b41](https://github.com/peerigon/eslint-config-peerigon/commit/6c45b41233bdc381bbc9916193cf3b07914fc8bb))
573 | - Update dependencies ([b52305e](https://github.com/peerigon/eslint-config-peerigon/commit/b52305ee79c201371d876e58d57a1163ec568ed4))
574 |
575 | ### Features
576 |
577 | - **react:** Allow functions created during render ([8c80148](https://github.com/peerigon/eslint-config-peerigon/commit/8c80148b27465fc896de2fdee9091a3ddcd9f736))
578 | - Lower severity of opinionated rules ([c0bea51](https://github.com/peerigon/eslint-config-peerigon/commit/c0bea5118cc6577d2f33bd40d93be1d94e0edce6))
579 | - **typescript:** Add new TypeScript rules ([9e77b24](https://github.com/peerigon/eslint-config-peerigon/commit/9e77b24ef7ff906c8a7259ba9b33ebb434dc45e7))
580 | - **typescript:** Disable @typescript-eslint/explicit-module-boundary-types again ([a88a683](https://github.com/peerigon/eslint-config-peerigon/commit/a88a6833367c45a85a8497fa207f4395c82fe736))
581 | - **typescript:** Enforce naming convention ([1fb0844](https://github.com/peerigon/eslint-config-peerigon/commit/1fb0844068673f22e6c2bcccb86852b10bb2aa8f))
582 | - **typescript:** Improve TypeScript support in base ESLint rules ([6763671](https://github.com/peerigon/eslint-config-peerigon/commit/6763671c22c9d5512f53294e33fcbc838fd12012))
583 | - Add @typescript-eslint/explicit-module-boundary-types ([3f106a0](https://github.com/peerigon/eslint-config-peerigon/commit/3f106a050bbfa2a3466fe985e1bd810856afb0b0))
584 | - Add bunch of JSDoc rules ([680550e](https://github.com/peerigon/eslint-config-peerigon/commit/680550e6415658081bebc89fd834081fecc61f96))
585 | - Add styles/no-default-export ([d8b0242](https://github.com/peerigon/eslint-config-peerigon/commit/d8b0242069d326e12c3dfb7247867c5dfd336d49))
586 | - Add styles/no-null ([a30511b](https://github.com/peerigon/eslint-config-peerigon/commit/a30511b1ea55dc8081375ffe0de245f34cc54e79))
587 | - Disable some jsdoc rules when using TypeScript ([82220fa](https://github.com/peerigon/eslint-config-peerigon/commit/82220fa862bcb2d3298a1c076b7a7c50b2794491))
588 | - Improve jsdoc rules ([0a6694d](https://github.com/peerigon/eslint-config-peerigon/commit/0a6694d061e4553ebde0653322b7567a69956e44))
589 | - Improve prettier support ([1cd6537](https://github.com/peerigon/eslint-config-peerigon/commit/1cd6537aa59fd53e9b3f40caa1f72b52a4a8dddf))
590 | - **base:** Add no-dupe-else-if ([0ee8136](https://github.com/peerigon/eslint-config-peerigon/commit/0ee8136bbff0e53d08def5bc818054b29bea097b))
591 | - **base:** Add prefer-exponentiation-operator ([fd41a01](https://github.com/peerigon/eslint-config-peerigon/commit/fd41a01e0692670375d43009f45704b02d02c1c3))
592 | - **base:** Add prefer-regex-literals ([01599bd](https://github.com/peerigon/eslint-config-peerigon/commit/01599bda47b1197fca321780a644c6a5693a54af))
593 | - **base:** Add require-atomic-updates ([69f2c36](https://github.com/peerigon/eslint-config-peerigon/commit/69f2c36d0d9b57d32a98f617c33cc407423b2904))
594 | - **base:** Add require-unicode-regexp ([0b44ba5](https://github.com/peerigon/eslint-config-peerigon/commit/0b44ba50add0a1a8b378c8f311000c2558fe3f54))
595 | - **base:** Disallow assignments of imports ([0e6af86](https://github.com/peerigon/eslint-config-peerigon/commit/0e6af861370cd95bbff8dc0f96c112cb3a26ba83))
596 | - **base:** Disallow return in constructors ([f9edbbc](https://github.com/peerigon/eslint-config-peerigon/commit/f9edbbcce36703d644b9ada2315e5be310ae7102))
597 | - **base:** Disallow return in setters ([f3f574c](https://github.com/peerigon/eslint-config-peerigon/commit/f3f574cfcff59a8e65efda84658a746246720e3d))
598 | - **base:** Require grouping of setters and getters ([94792f2](https://github.com/peerigon/eslint-config-peerigon/commit/94792f2a8ab22bb777fa70ba09ef96ecefee0e38))
599 |
600 | ### BREAKING CHANGES
601 |
602 | - **react:** The default style now is to allow functions created during render. The style peerigon/styles/react-jsx-allow-bind has been removed and replaced by its opposite peerigon/styles/react-jsx-no-bind for applications that use memo a lot.
603 |
604 | The motivation behind this is that it's more convenient for a lot of people to create functions during render. The performance downside is usually not an issue and can be mitigated by better usage of useState().
605 |
606 | - **typescript:** There are new rules for TypeScript code:
607 |
608 | * [no-dynamic-delete](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.md)
609 | * [no-extra-non-null-assertion](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md)
610 | * [no-floating-promises](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md)
611 | * [no-non-null-asserted-optional-chain](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md)
612 | * [no-unnecessary-condition](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md)
613 | * [prefer-as-con](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-as-const.md)
614 | * [prefer-nullish-coalescing](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md)
615 | * [prefer-optional-chain](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-optional-chain.md)
616 | * [restrict-template-expressions](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md)
617 | * [return-await](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md)
618 | * [switch-exhaustiveness-check](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md)
619 |
620 | - **typescript:** The new rule enforces the consistent use of camelCase, PascalCase and UPPER_CASE for variable, property and member names. Additionally, only PascalCase is allowed for type-like structures.
621 | - Exported functions now need to specify an explicit return type. This enforces everyone to be explicit about the public interface of the module. This is likely to increase the developer experience because type errors will show up closer to the actual error.
622 | - Use param instead of arg and argument.
623 | - The prettier config now uses tabs instead of spaces. This is not actually breaking since Prettier will just format your code in a different way, but it will produce a lot of noise.
624 | - globPatterns.js has been renamed to glob-patterns.js
625 | - **base:** Require u flag in all regexes. The u flag adds unicode support and reports invalid regex patterns.
626 | - **base:** ESLint now reports a potential unsafe use of +=,-=,\*=,/= in combination with async await
627 | - **base:** Regex literals are now preferred over new RegExp() if the regex is not dynamic.
628 | - **base:** The exponentiation operator is now preferred over Math.pow()
629 | - Support for Node versions below 10 has been removed.
630 | - **base:** Setters can't return values. This is enforced with a linting rule now. See https://eslint.org/docs/rules/no-setter-return
631 | - **base:** Assignments of imports are now disallowed. They throw a runtime error anyway. See https://eslint.org/docs/rules/no-import-assign
632 | - **base:** Certain If-else usages that were an error anyway are now a linting error. See ttps://eslint.org/docs/rules/no-dupe-else-if
633 | - **base:** Returning values from constructors is not allowed anymore. See https://eslint.org/docs/rules/no-constructor-return
634 | - **base:** Setters and getters now need to be grouped together. See https://eslint.org/docs/rules/grouped-accessor-pairs
635 | - Remove official ESLint 5 support
636 |
637 | # [26.0.0-beta.3](https://github.com/peerigon/eslint-config-peerigon/compare/v26.0.0-beta.2...v26.0.0-beta.3) (2020-02-06)
638 |
639 | ### Features
640 |
641 | - Disable some jsdoc rules when using TypeScript ([82220fa](https://github.com/peerigon/eslint-config-peerigon/commit/82220fa862bcb2d3298a1c076b7a7c50b2794491))
642 |
643 | # [26.0.0-beta.2](https://github.com/peerigon/eslint-config-peerigon/compare/v26.0.0-beta.1...v26.0.0-beta.2) (2020-02-06)
644 |
645 | ### Features
646 |
647 | - Improve jsdoc rules ([0a6694d](https://github.com/peerigon/eslint-config-peerigon/commit/0a6694d061e4553ebde0653322b7567a69956e44))
648 |
649 | ### BREAKING CHANGES
650 |
651 | - Use param instead of arg and argument.
652 |
653 | # [26.0.0-beta.1](https://github.com/peerigon/eslint-config-peerigon/compare/v25.3.0...v26.0.0-beta.1) (2020-02-06)
654 |
655 | ### Bug Fixes
656 |
657 | - **base:** Increase soft limit of complexity rule ([a78a702](https://github.com/peerigon/eslint-config-peerigon/commit/a78a702f5b5d16ff9b11237ee9c059618f80eb32))
658 | - Fine-tune soft limits of max-lines and max-dependencies ([a123f41](https://github.com/peerigon/eslint-config-peerigon/commit/a123f41676aad7b3d56ff35512774fd4860093d9))
659 | - **typescript:** Do not "fix" 'any' to 'unknown' ([154a42b](https://github.com/peerigon/eslint-config-peerigon/commit/154a42b1de215ffa763f7da32a66588695d5dad0))
660 |
661 | ### chore
662 |
663 | - Refactor glob-patterns module ([1db1f22](https://github.com/peerigon/eslint-config-peerigon/commit/1db1f22dedf8a9d1c6cc7342391f3774288e93dc))
664 | - Remove support for Node<10 ([6c45b41](https://github.com/peerigon/eslint-config-peerigon/commit/6c45b41233bdc381bbc9916193cf3b07914fc8bb))
665 | - Update dependencies ([b52305e](https://github.com/peerigon/eslint-config-peerigon/commit/b52305ee79c201371d876e58d57a1163ec568ed4))
666 |
667 | ### Features
668 |
669 | - Add styles/no-default-export ([d8b0242](https://github.com/peerigon/eslint-config-peerigon/commit/d8b0242069d326e12c3dfb7247867c5dfd336d49))
670 | - Add styles/no-null ([a30511b](https://github.com/peerigon/eslint-config-peerigon/commit/a30511b1ea55dc8081375ffe0de245f34cc54e79))
671 | - Improve prettier support ([1cd6537](https://github.com/peerigon/eslint-config-peerigon/commit/1cd6537aa59fd53e9b3f40caa1f72b52a4a8dddf))
672 | - **base:** Add no-dupe-else-if ([0ee8136](https://github.com/peerigon/eslint-config-peerigon/commit/0ee8136bbff0e53d08def5bc818054b29bea097b))
673 | - **base:** Add prefer-exponentiation-operator ([fd41a01](https://github.com/peerigon/eslint-config-peerigon/commit/fd41a01e0692670375d43009f45704b02d02c1c3))
674 | - **base:** Add prefer-regex-literals ([01599bd](https://github.com/peerigon/eslint-config-peerigon/commit/01599bda47b1197fca321780a644c6a5693a54af))
675 | - **base:** Add require-atomic-updates ([69f2c36](https://github.com/peerigon/eslint-config-peerigon/commit/69f2c36d0d9b57d32a98f617c33cc407423b2904))
676 | - **base:** Add require-unicode-regexp ([0b44ba5](https://github.com/peerigon/eslint-config-peerigon/commit/0b44ba50add0a1a8b378c8f311000c2558fe3f54))
677 | - **base:** Disallow assignments of imports ([0e6af86](https://github.com/peerigon/eslint-config-peerigon/commit/0e6af861370cd95bbff8dc0f96c112cb3a26ba83))
678 | - **base:** Disallow return in constructors ([f9edbbc](https://github.com/peerigon/eslint-config-peerigon/commit/f9edbbcce36703d644b9ada2315e5be310ae7102))
679 | - **base:** Disallow return in setters ([f3f574c](https://github.com/peerigon/eslint-config-peerigon/commit/f3f574cfcff59a8e65efda84658a746246720e3d))
680 | - **base:** Require grouping of setters and getters ([94792f2](https://github.com/peerigon/eslint-config-peerigon/commit/94792f2a8ab22bb777fa70ba09ef96ecefee0e38))
681 | - Add bunch of JSDoc rules ([680550e](https://github.com/peerigon/eslint-config-peerigon/commit/680550e6415658081bebc89fd834081fecc61f96))
682 |
683 | ### BREAKING CHANGES
684 |
685 | - The prettier config now uses tabs instead of spaces. This is not actually breaking since Prettier will just format your code in a different way, but it will produce a lot of noise.
686 | - globPatterns.js has been renamed to glob-patterns.js
687 | - **base:** Require u flag in all regexes. The u flag adds unicode support and reports invalid regex patterns.
688 | - **base:** ESLint now reports a potential unsafe use of +=,-=,\*=,/= in combination with async await
689 | - **base:** Regex literals are now preferred over new RegExp() if the regex is not dynamic.
690 | - **base:** The exponentiation operator is now preferred over Math.pow()
691 | - Support for Node versions below 10 has been removed.
692 | - **base:** Setters can't return values. This is enforced with a linting rule now. See https://eslint.org/docs/rules/no-setter-return
693 | - **base:** Assignments of imports are now disallowed. They throw a runtime error anyway. See https://eslint.org/docs/rules/no-import-assign
694 | - **base:** Certain If-else usages that were an error anyway are now a linting error. See ttps://eslint.org/docs/rules/no-dupe-else-if
695 | - **base:** Returning values from constructors is not allowed anymore. See https://eslint.org/docs/rules/no-constructor-return
696 | - **base:** Setters and getters now need to be grouped together. See https://eslint.org/docs/rules/grouped-accessor-pairs
697 | - Remove official ESLint 5 support
698 |
699 | # [25.3.0](https://github.com/peerigon/eslint-config-peerigon/compare/v25.2.0...v25.3.0) (2020-02-01)
700 |
701 | ### Bug Fixes
702 |
703 | - **base:** Allow finally() as a replacement for catch() ([0d2b2df](https://github.com/peerigon/eslint-config-peerigon/commit/0d2b2df))
704 |
705 | ### Features
706 |
707 | - **base:** Relax eqeqeq ([e8f9cd6](https://github.com/peerigon/eslint-config-peerigon/commit/e8f9cd6))
708 | - **react:** Relax react/require-default-props rule ([8be6c52](https://github.com/peerigon/eslint-config-peerigon/commit/8be6c52))
709 | - **typescript:** Relax @typescript-eslint/strict-boolean-expressions rule ([524c462](https://github.com/peerigon/eslint-config-peerigon/commit/524c462))
710 |
711 | # [25.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v25.1.1...v25.2.0) (2020-01-23)
712 |
713 | ### Features
714 |
715 | - Add semantic-release ([eb3f1d4](https://github.com/peerigon/eslint-config-peerigon/commit/eb3f1d4e8f4b01377865582e4816f859c628e46f))
716 |
717 | # Changelog
718 |
719 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
720 |
721 | ### [25.1.1](https://github.com/peerigon/eslint-config-peerigon/compare/v25.1.0...v25.1.1) (2020-01-13)
722 |
723 | ### Bug Fixes
724 |
725 | - Turn off no-empty-function for TypeScript ([1c8c5ac](https://github.com/peerigon/eslint-config-peerigon/commit/1c8c5ac))
726 |
727 | ## [25.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v25.0.1...v25.1.0) (2020-01-10)
728 |
729 | ### Bug Fixes
730 |
731 | - Disable import/extensions for tsx files ([b13c7f6](https://github.com/peerigon/eslint-config-peerigon/commit/b13c7f6))
732 |
733 | ### Features
734 |
735 | - Allow ESLint 6 as peer dependency ([e474e5e](https://github.com/peerigon/eslint-config-peerigon/commit/e474e5e))
736 |
737 | ### [25.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v25.0.0...v25.0.1) (2019-12-25)
738 |
739 | ### Bug Fixes
740 |
741 | - Allow template literals for Jest inline snapshots ([2b9c4e5](https://github.com/peerigon/eslint-config-peerigon/commit/2b9c4e5))
742 |
743 | ## [25.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v24.0.0...v25.0.0) (2019-12-23)
744 |
745 | ### Bug Fixes
746 |
747 | - Allow non-null assertions in test files ([240beec](https://github.com/peerigon/eslint-config-peerigon/commit/240beec))
748 | - Do not require .ts extensions in TypeScript files ([e40ffbe](https://github.com/peerigon/eslint-config-peerigon/commit/e40ffbe))
749 | - Turn off consistent-type-definitions in d.ts files ([1c00846](https://github.com/peerigon/eslint-config-peerigon/commit/1c00846))
750 |
751 | ### Features
752 |
753 | - Don't allow loose equality checks ([8e065bf](https://github.com/peerigon/eslint-config-peerigon/commit/8e065bf))
754 |
755 | ### BREAKING CHANGES
756 |
757 | - Loose equality checks are not allowed anymore.
758 |
759 | ## [24.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v23.2.0...v24.0.0) (2019-08-23)
760 |
761 | ### Features
762 |
763 | - Update TypeScript rules ([31fbf88](https://github.com/peerigon/eslint-config-peerigon/commit/31fbf88))
764 |
765 | ### BREAKING CHANGES
766 |
767 | - You need to update `@typescript-eslint/eslint-plugin@^2.0.0` if you're using the TypeScript rules. The recommended rules changed a little bit and there have been some breaking rule changes like `@typescript-eslint/consistent-type-assertions`, `@typescript-eslint/no-unnecessary-type-arguments` and `@typescript-eslint/strict-boolean-expressions`
768 |
769 | ## [23.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v23.1.0...v23.2.0) (2019-08-02)
770 |
771 | ### Bug Fixes
772 |
773 | - Disable `react/jsx-no-literals` in tests ([ed93deb](https://github.com/peerigon/eslint-config-peerigon/commit/ed93deb))
774 |
775 | ### Features
776 |
777 | - Disable `react/jsx-one-expression-per-line` ([136a945](https://github.com/peerigon/eslint-config-peerigon/commit/136a945))
778 |
779 | ## [23.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v23.0.0...v23.1.0) (2019-08-01)
780 |
781 | ### Features
782 |
783 | - Disable `react/jsx-wrap-multilines` ([2eb57e2](https://github.com/peerigon/eslint-config-peerigon/commit/2eb57e2))
784 |
785 | ## [23.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v22.1.0...v23.0.0) (2019-08-01)
786 |
787 | ### Bug Fixes
788 |
789 | - Add additional check for tsconfig.json resolving ([dd53d16](https://github.com/peerigon/eslint-config-peerigon/commit/dd53d16))
790 |
791 | ### Features
792 |
793 | - Enable `@typescript-eslint/explicit-member-accessibility rule` ([f036659](https://github.com/peerigon/eslint-config-peerigon/commit/f036659))
794 | - Relax `import/order` rule ([ae8d12a](https://github.com/peerigon/eslint-config-peerigon/commit/ae8d12a))
795 |
796 | ### BREAKING CHANGES
797 |
798 | - The `@typescript-eslint/explicit-member-accessibility` rule will now reports errors when someone uses the public keyword in TypeScript classes where it is not necessary.
799 |
800 | ## [22.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v22.0.0...v22.1.0) (2019-07-31)
801 |
802 | ### Features
803 |
804 | - Add Prettier config ([4d5e84e](https://github.com/peerigon/eslint-config-peerigon/commit/4d5e84e))
805 | - Disable id-length ([a8c791b](https://github.com/peerigon/eslint-config-peerigon/commit/a8c791b))
806 | - Relax @typescript-eslint/no-floating-promises ([ce7bf3e](https://github.com/peerigon/eslint-config-peerigon/commit/ce7bf3e))
807 |
808 | ## [22.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v21.2.0...v22.0.0) (2019-07-15)
809 |
810 | ### Bug Fixes
811 |
812 | - Change @typescript-eslint/member-delimiter-style ([e8dda25](https://github.com/peerigon/eslint-config-peerigon/commit/e8dda25))
813 | - Turn of react/prop-types for TypeScript files ([afe4ef5](https://github.com/peerigon/eslint-config-peerigon/commit/afe4ef5))
814 |
815 | ### Features
816 |
817 | - Enable test rules by glob pattern ([63c023c](https://github.com/peerigon/eslint-config-peerigon/commit/63c023c))
818 | - Recognize @testing-library/jest-dom/extend-expect as module with side-effects ([3ff10a2](https://github.com/peerigon/eslint-config-peerigon/commit/3ff10a2))
819 | - Relax some import rules ([6efa5a3](https://github.com/peerigon/eslint-config-peerigon/commit/6efa5a3))
820 | - Relax typescript rules in tests ([c73ee22](https://github.com/peerigon/eslint-config-peerigon/commit/c73ee22))
821 |
822 | ### BREAKING CHANGES
823 |
824 | - Change back to @typescript-eslint/member-delimiter-style "semi" because we want to stay consistent with classes. Sorry for the noise :(
825 |
826 | ## [21.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v21.1.0...v21.2.0) (2019-07-09)
827 |
828 | ### Features
829 |
830 | - Detect React version ([0b85c38](https://github.com/peerigon/eslint-config-peerigon/commit/0b85c38))
831 |
832 | ## [21.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v21.0.0...v21.1.0) (2019-07-09)
833 |
834 | ### Features
835 |
836 | - Introduce peerigon/styles/react-jsx-no-literals ([8c0425f](https://github.com/peerigon/eslint-config-peerigon/commit/8c0425f))
837 |
838 | ## [21.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v20.0.1...v21.0.0) (2019-07-09)
839 |
840 | ### Features
841 |
842 | - Add eslint-plugin-react-hooks ([6c0d0a3](https://github.com/peerigon/eslint-config-peerigon/commit/6c0d0a3))
843 | - Add styles/react-jsx-allow-bind ([a8e4326](https://github.com/peerigon/eslint-config-peerigon/commit/a8e4326))
844 | - Disable promise/prefer-await-to-then and promise/prefer-await-to-callbacks ([b715e44](https://github.com/peerigon/eslint-config-peerigon/commit/b715e44))
845 | - Relax import/max-dependencies and max-lines ([f692e4b](https://github.com/peerigon/eslint-config-peerigon/commit/f692e4b))
846 | - Relax max-lines in tests ([cd1e294](https://github.com/peerigon/eslint-config-peerigon/commit/cd1e294))
847 | - Relax react/jsx-no-bind ([89873c3](https://github.com/peerigon/eslint-config-peerigon/commit/89873c3))
848 | - Switch off react/no-multi-comp ([366636a](https://github.com/peerigon/eslint-config-peerigon/commit/366636a))
849 |
850 | ### BREAKING CHANGES
851 |
852 | - There are linting rules for React hooks now.
853 |
854 | ### [20.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v20.0.0...v20.0.1) (2019-07-08)
855 |
856 | ### Bug Fixes
857 |
858 | - Allow jsdoc [@swagger](https://github.com/swagger) tags ([b59eb2b](https://github.com/peerigon/eslint-config-peerigon/commit/b59eb2b))
859 |
860 | ## [20.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v19.0.0...v20.0.0) (2019-07-08)
861 |
862 | ### Bug Fixes
863 |
864 | - Add note on @typescript-eslint/parser in README ([898abe3](https://github.com/peerigon/eslint-config-peerigon/commit/898abe3))
865 | - Disable import rules that are slow ([41edcb2](https://github.com/peerigon/eslint-config-peerigon/commit/41edcb2))
866 | - Improve options for import/no-extraneous-dependencies ([5fe07e6](https://github.com/peerigon/eslint-config-peerigon/commit/5fe07e6))
867 | - Reuse no-unused-vars option in TypeScript ([44464ac](https://github.com/peerigon/eslint-config-peerigon/commit/44464ac))
868 |
869 | ### Features
870 |
871 | - Ignore long comments in max-len rule ([4a8d39d](https://github.com/peerigon/eslint-config-peerigon/commit/4a8d39d))
872 | - Increase import/max-dependencies to 20 ([f5d6c9d](https://github.com/peerigon/eslint-config-peerigon/commit/f5d6c9d))
873 | - Refactor TypeScript rules ([302d840](https://github.com/peerigon/eslint-config-peerigon/commit/302d840))
874 | - Update dependencies ([32914ef](https://github.com/peerigon/eslint-config-peerigon/commit/32914ef))
875 |
876 | ### BREAKING CHANGES
877 |
878 | - Added and changed a lot of TypeScript rules. This change was necessary because a lot of new rules have been added to @typescript-eslint. Also adds some performance improvements.
879 | - eslint-plugin-jsdoc received a major version bump
880 | - The pattern for devDependencies checked by import/no-extraneous-dependencies has changed
881 |
882 | ## [19.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v17.1.0...v19.0.0) (2019-05-29)
883 |
884 | ### Bug Fixes
885 |
886 | - Activate TypeScript rules only for \*.tsx? files ([338d98f](https://github.com/peerigon/eslint-config-peerigon/commit/338d98f))
887 | - Remove JS file overrides in typescript rules ([68fc6df](https://github.com/peerigon/eslint-config-peerigon/commit/68fc6df))
888 |
889 | ### chore
890 |
891 | - Update dependencies ([b28d7a4](https://github.com/peerigon/eslint-config-peerigon/commit/b28d7a4))
892 |
893 | ### Features
894 |
895 | - Add lines-between-class-members rule ([b0ce663](https://github.com/peerigon/eslint-config-peerigon/commit/b0ce663))
896 | - Disable arrow-body-style and arrow-parens rule ([c50a7b4](https://github.com/peerigon/eslint-config-peerigon/commit/c50a7b4))
897 |
898 | ### BREAKING CHANGES
899 |
900 | - eslint-plugin-jsdoc received a major version update.
901 | - It's now required to add a new line between multiline class members.
902 | - Remove sourceType = script parser option for JS files in
903 | TypeScript projects. This override made the wrong
904 | assumption that all JS files should be scripts in a
905 | TypeScript project which is certainly not correct.
906 |
907 | # [18.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v17.1.0...v18.0.0) (2019-05-29)
908 |
909 | ### Bug Fixes
910 |
911 | - Remove JS file overrides in typescript rules ([ef27f23](https://github.com/peerigon/eslint-config-peerigon/commit/ef27f23))
912 |
913 | ### BREAKING CHANGES
914 |
915 | - Remove sourceType = script parser option for JS files in
916 | TypeScript projects. This override made the wrong
917 | assumption that all JS files should be scripts in a
918 | TypeScript project which is certainly not correct.
919 |
920 |
921 |
922 | # [17.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v17.0.0...v17.1.0) (2019-02-22)
923 |
924 | ### Features
925 |
926 | - Add prefer-interface style for TypeScript apps ([#58](https://github.com/peerigon/eslint-config-peerigon/issues/58)) ([529503f](https://github.com/peerigon/eslint-config-peerigon/commit/529503f))
927 |
928 |
929 |
930 | # [17.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v16.0.0...v17.0.0) (2019-02-21)
931 |
932 | ### Features
933 |
934 | - Add new rule ([#57](https://github.com/peerigon/eslint-config-peerigon/issues/57)) ([7bde0ba](https://github.com/peerigon/eslint-config-peerigon/commit/7bde0ba))
935 |
936 | ### BREAKING CHANGES
937 |
938 | - - "optimize-regex/optimize-regex": "error"
939 |
940 |
941 |
942 | ## [16.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v15.0.2...v16.0.0) (2019-02-21)
943 |
944 | ### Features
945 |
946 | - Add and refactor rules ([be86a71](https://github.com/peerigon/eslint-config-peerigon/commit/be86a71))
947 |
948 | ### BREAKING CHANGES
949 |
950 | - This commit adds and changes a bunch of TypeScript rules because the original plugin was deprecated.
951 |
952 | However, there were also notable changes to the base rules:
953 |
954 | - "array-func/prefer-flat-map": "error" // https://github.com/freaktechnik/eslint-plugin-array-func
955 | - "jsdoc/check-examples": "error"
956 | - "jsdoc/require-returns": "error"
957 | - "jsdoc/require-returns-check": "error"
958 |
959 |
960 |
961 | ## [15.0.2](https://github.com/peerigon/eslint-config-peerigon/compare/v15.0.1...v15.0.2) (2018-08-31)
962 |
963 | ### Bug Fixes
964 |
965 | - Wrong rule configurations ([#49](https://github.com/peerigon/eslint-config-peerigon/issues/49)) ([58da102](https://github.com/peerigon/eslint-config-peerigon/commit/58da102))
966 |
967 |
968 |
969 | ## [15.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v15.0.0...v15.0.1) (2018-08-30)
970 |
971 | ### Bug Fixes
972 |
973 | - Disable no-empty rule in tests config ([#48](https://github.com/peerigon/eslint-config-peerigon/issues/48)) ([a1a1431](https://github.com/peerigon/eslint-config-peerigon/commit/a1a1431))
974 |
975 |
976 |
977 | # [15.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v14.0.0...v15.0.0) (2018-08-29)
978 |
979 | ### Bug Fixes
980 |
981 | - Enable singular folder names ([#46](https://github.com/peerigon/eslint-config-peerigon/issues/46)) ([166eece](https://github.com/peerigon/eslint-config-peerigon/commit/166eece))
982 |
983 | ### Features
984 |
985 | - Enforce eol-last ([#47](https://github.com/peerigon/eslint-config-peerigon/issues/47)) ([985d474](https://github.com/peerigon/eslint-config-peerigon/commit/985d474))
986 |
987 | ### BREAKING CHANGES
988 |
989 | - Enforce [eol-last](https://eslint.org/docs/rules/eol-last)
990 |
991 |
992 |
993 | # [14.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v13.0.0...v14.0.0) (2018-08-27)
994 |
995 | ### Bug Fixes
996 |
997 | - Add eslint-plugin-babel ([#33](https://github.com/peerigon/eslint-config-peerigon/issues/33)) ([3032b19](https://github.com/peerigon/eslint-config-peerigon/commit/3032b19))
998 | - Disable array-func/prefer-array-from ([#35](https://github.com/peerigon/eslint-config-peerigon/issues/35)) ([69e2601](https://github.com/peerigon/eslint-config-peerigon/commit/69e2601))
999 | - Disable react/destructuring-assignment ([#36](https://github.com/peerigon/eslint-config-peerigon/issues/36)) ([01eaced](https://github.com/peerigon/eslint-config-peerigon/commit/01eaced))
1000 | - Disable require-yield ([#37](https://github.com/peerigon/eslint-config-peerigon/issues/37)) ([8e7ceb7](https://github.com/peerigon/eslint-config-peerigon/commit/8e7ceb7))
1001 | - Fix react rules ([#43](https://github.com/peerigon/eslint-config-peerigon/issues/43)) ([47b82bb](https://github.com/peerigon/eslint-config-peerigon/commit/47b82bb)), closes [/github.com/yannickcr/eslint-plugin-react/issues/1679#issuecomment-363908562](https://github.com//github.com/yannickcr/eslint-plugin-react/issues/1679/issues/issuecomment-363908562)
1002 | - Lower the severity of some rules ([#39](https://github.com/peerigon/eslint-config-peerigon/issues/39)) ([4c4f531](https://github.com/peerigon/eslint-config-peerigon/commit/4c4f531))
1003 | - Remove eslint-plugin-security ([#38](https://github.com/peerigon/eslint-config-peerigon/issues/38)) ([e329dc0](https://github.com/peerigon/eslint-config-peerigon/commit/e329dc0))
1004 | - Replace deprecated experimentalObjectRestSpread option ([#42](https://github.com/peerigon/eslint-config-peerigon/issues/42)) ([6509fe8](https://github.com/peerigon/eslint-config-peerigon/commit/6509fe8))
1005 |
1006 | ### Features
1007 |
1008 | - Add no-unsafe-regex plugin ([#34](https://github.com/peerigon/eslint-config-peerigon/issues/34)) ([1b17d18](https://github.com/peerigon/eslint-config-peerigon/commit/1b17d18))
1009 | - Add TypeScript rules ([#44](https://github.com/peerigon/eslint-config-peerigon/issues/44)) ([a25ec5a](https://github.com/peerigon/eslint-config-peerigon/commit/a25ec5a))
1010 | - Config new rules ([#32](https://github.com/peerigon/eslint-config-peerigon/issues/32)) ([fc9f007](https://github.com/peerigon/eslint-config-peerigon/commit/fc9f007))
1011 | - Enable arrow-parens rule ([#40](https://github.com/peerigon/eslint-config-peerigon/issues/40)) ([6ef3259](https://github.com/peerigon/eslint-config-peerigon/commit/6ef3259))
1012 | - Introduce custom style one-line arrow functions ([#41](https://github.com/peerigon/eslint-config-peerigon/issues/41)) ([3555781](https://github.com/peerigon/eslint-config-peerigon/commit/3555781))
1013 | - Update dependencies ([#31](https://github.com/peerigon/eslint-config-peerigon/issues/31)) ([0ff4147](https://github.com/peerigon/eslint-config-peerigon/commit/0ff4147))
1014 |
1015 | ### BREAKING CHANGES
1016 |
1017 | - - Switch back to jsx and tsx extension
1018 | - Switch to multiline-multiprop in react/jsx-first-prop-new-line
1019 | - Arrow functions shouldn't have parenthesis around
1020 | a single argument
1021 | - The new rule can break tests
1022 | - jsdoc/no-undefined-types and jsdoc/valid-types are errors
1023 | now. This could break tests.
1024 | - Update peer dependency on eslint to ^5.4.0
1025 |
1026 |
1027 |
1028 | # [13.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v12.0.1...v13.0.0) (2018-04-27)
1029 |
1030 | ### Features
1031 |
1032 | - Add eslint-plugin-flowtype-errors ([fc15db3](https://github.com/peerigon/eslint-config-peerigon/commit/fc15db3))
1033 | - Add eslint-plugin-jsx-a11y to react rules ([7d8dbdc](https://github.com/peerigon/eslint-config-peerigon/commit/7d8dbdc))
1034 | - Add useful eslint plugins to base rules ([caf6088](https://github.com/peerigon/eslint-config-peerigon/commit/caf6088))
1035 | - Allow nested ternaries ([15107ac](https://github.com/peerigon/eslint-config-peerigon/commit/15107ac))
1036 | - Allow possibly undefined variables in typeof checks ([1e657c3](https://github.com/peerigon/eslint-config-peerigon/commit/1e657c3))
1037 | - Configure new rules ([273e139](https://github.com/peerigon/eslint-config-peerigon/commit/273e139))
1038 | - Enforce multiline ternary for long expressions ([92031d2](https://github.com/peerigon/eslint-config-peerigon/commit/92031d2))
1039 | - Make file extensions mandatory in imports ([6ea3964](https://github.com/peerigon/eslint-config-peerigon/commit/6ea3964))
1040 | - Refactor import rules ([53f41d4](https://github.com/peerigon/eslint-config-peerigon/commit/53f41d4))
1041 | - Refactor node rules ([8a4e2b5](https://github.com/peerigon/eslint-config-peerigon/commit/8a4e2b5))
1042 | - Refactor react rules ([9994d2b](https://github.com/peerigon/eslint-config-peerigon/commit/9994d2b))
1043 | - Refactor react/jsx-wrap-multilines rules ([efe8ebd](https://github.com/peerigon/eslint-config-peerigon/commit/efe8ebd))
1044 | - Refactor tests rules ([820124f](https://github.com/peerigon/eslint-config-peerigon/commit/820124f))
1045 | - Remove curly and bracket spacings ([4ff321c](https://github.com/peerigon/eslint-config-peerigon/commit/4ff321c))
1046 | - Remove eslint-plugin-flowtype-error again ([13bbca7](https://github.com/peerigon/eslint-config-peerigon/commit/13bbca7))
1047 | - Remove fp rules ([34543bc](https://github.com/peerigon/eslint-config-peerigon/commit/34543bc))
1048 | - Switch back to babel-eslint again ([f3ba862](https://github.com/peerigon/eslint-config-peerigon/commit/f3ba862))
1049 | - Switch back to eslint default parser ([#18](https://github.com/peerigon/eslint-config-peerigon/issues/18)) ([5ab10a8](https://github.com/peerigon/eslint-config-peerigon/commit/5ab10a8))
1050 | - Update peerigon/node to match node >= 6 ([c8ff737](https://github.com/peerigon/eslint-config-peerigon/commit/c8ff737))
1051 |
1052 | ### BREAKING CHANGES
1053 |
1054 | - If you're using Flowtype and the flowtype rules,
1055 | you just need to call ESLint now to also do the typechecking.
1056 | - You need to add babel-eslint as project dependencies in project where the peerigon/flowtype rules are used. You don't need to change anything if you're using other rules.
1057 | - These plugins introduce new rules that might
1058 | cause linting errors now.
1059 | - - Add autofixable order of imports
1060 |
1061 | * Discourage anonymous default exports
1062 |
1063 | - Changes a lot of rules that are concerned with
1064 | whitespace after curlies and brackets. For consistency reasons,
1065 | we do not write spaces after these characters.
1066 | - Always add new line before multiline wraps. This change
1067 | was necessary because of the new react/jsx-closing-tag-location
1068 | which requires the closing tag to be on the same indentation as the
1069 | opening tag. In combination with the parentheses rule, it could lead
1070 | to an unstable state where eslint was trying to fix it
1071 | by switching back and forth between two states.
1072 | - This change adds a lot of new rules which
1073 | help us to improve the accessibility of our applications.
1074 | - There are new rules that might cause errors now.
1075 | - The padded-blocks rule has been activated for tests again.
1076 | - The fp rules where part of an experiment.
1077 | These overly strict rules don't make sense in JavaScript.
1078 | - Remove node 4 support
1079 | - - "import/extensions": ["error", "ignorePackages"],
1080 | - - "multiline-ternary": ["error", "always-multiline"]
1081 | - - import/no-self-import error
1082 |
1083 | * import/no-useless-path-segments error
1084 |
1085 | - A lof of rules have changed, expect some new errors.
1086 |
1087 |
1088 |
1089 | ## [12.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v12.0.0...v12.0.1) (2017-10-26)
1090 |
1091 |
1092 |
1093 | # [12.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v11.3.1...v12.0.0) (2017-10-26)
1094 |
1095 | ### Chores
1096 |
1097 | - Update eslint peer dependency ([b0c3e28](https://github.com/peerigon/eslint-config-peerigon/commit/b0c3e28))
1098 |
1099 | ### Features
1100 |
1101 | - Update rules ([#14](https://github.com/peerigon/eslint-config-peerigon/issues/14)) ([47edb7e](https://github.com/peerigon/eslint-config-peerigon/commit/47edb7e))
1102 |
1103 | ### BREAKING CHANGES
1104 |
1105 | - The eslint-config-peerigon now requires at least eslint@^4.9.0
1106 | - There have been new rules added which might break your build. But they should be auto-fixable 🖖
1107 |
1108 |
1109 |
1110 | ## [11.3.1](https://github.com/peerigon/eslint-config-peerigon/compare/v11.3.0...v11.3.1) (2017-06-25)
1111 |
1112 | ### Bug Fixes
1113 |
1114 | - Switch off react/no-set-state ([f4139d4](https://github.com/peerigon/eslint-config-peerigon/commit/f4139d4))
1115 |
1116 |
1117 |
1118 | # [11.3.0](https://github.com/peerigon/eslint-config-peerigon/compare/v11.2.0...v11.3.0) (2017-06-23)
1119 |
1120 | ### Features
1121 |
1122 | - Relax class-methods-use-this to warn because it should be a hint ([9af3645](https://github.com/peerigon/eslint-config-peerigon/commit/9af3645))
1123 | - Relax react rules ([a026414](https://github.com/peerigon/eslint-config-peerigon/commit/a026414))
1124 |
1125 |
1126 |
1127 | # [11.2.0](https://github.com/peerigon/eslint-config-peerigon/compare/v11.1.0...v11.2.0) (2017-06-22)
1128 |
1129 | ### Features
1130 |
1131 | - Relax no-extraneous-dependencies rule ([50710b5](https://github.com/peerigon/eslint-config-peerigon/commit/50710b5))
1132 |
1133 |
1134 |
1135 | # [11.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v11.0.1...v11.1.0) (2017-06-22)
1136 |
1137 | ### Features
1138 |
1139 | - Relax import/no-extraneous-dependencies rule ([4c26ba0](https://github.com/peerigon/eslint-config-peerigon/commit/4c26ba0))
1140 |
1141 |
1142 |
1143 | ## [11.0.1](https://github.com/peerigon/eslint-config-peerigon/compare/v11.0.0...v11.0.1) (2017-06-22)
1144 |
1145 | ### Bug Fixes
1146 |
1147 | - Missing plugin declaration in react rules ([3a39340](https://github.com/peerigon/eslint-config-peerigon/commit/3a39340))
1148 |
1149 |
1150 |
1151 | # [11.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v10.1.1...v11.0.0) (2017-06-22)
1152 |
1153 | ### Chores
1154 |
1155 | - Remove eslint-plugin-flowtype ([e99537a](https://github.com/peerigon/eslint-config-peerigon/commit/e99537a))
1156 |
1157 | ### BREAKING CHANGES
1158 |
1159 | - This commit removes eslint-plugin-flowtype from the package.json. In case you're using the flowtype config, you need to add eslint-plugin-flowtype to your package.json now.
1160 |
1161 |
1162 |
1163 | ## [10.1.1](https://github.com/peerigon/eslint-config-peerigon/compare/v10.1.0...v10.1.1) (2017-04-03)
1164 |
1165 | ### Bug Fixes
1166 |
1167 | - Turn off "prefer-rest" in node rules ([b0af121](https://github.com/peerigon/eslint-config-peerigon/commit/b0af121))
1168 |
1169 |
1170 |
1171 | # [10.1.0](https://github.com/peerigon/eslint-config-peerigon/compare/v10.0.0...v10.1.0) (2017-04-03)
1172 |
1173 | ### Features
1174 |
1175 | - Remove no-confusing-arrow rule ([bb20a58](https://github.com/peerigon/eslint-config-peerigon/commit/bb20a58))
1176 |
1177 |
1178 |
1179 | # [10.0.0](https://github.com/peerigon/eslint-config-peerigon/compare/v9.0.0...v10.0.0) (2017-03-31)
1180 |
1181 | ### Features
1182 |
1183 | - Refactor rules ([691bfb2](https://github.com/peerigon/eslint-config-peerigon/commit/691bfb2))
1184 |
1185 | ### BREAKING CHANGES
1186 |
1187 | - This version introduces also some breaking changes:
1188 |
1189 | * Switch "no-alert" to "error" (a831ed4fc3b17d4a932745cdda7f31cbc00e955d)
1190 | * Switch "no-bitwise" to "error" (e8f38b6289c6b3ae7d17dc35a445b1837143c4bd)
1191 | * Switch "no-eq-null" to "error" (329ae4bbaf5b4fd732f899bd89cd8f152b7ac1e2)
1192 | * Switch "no-process-exit" to "error" (850275f029ea37c85c7e766f8d976a38ea89dce3)
1193 | * Switch "no-script-url" to "error" (5b10357db3fe6f836858066c44e740956ad3df61)
1194 | * Switch "no-useless-call" to "error" (66ab5190f01d27d81c5d0654c303f77466c37d47)
1195 | * Switch "no-script-url" to "error" (5b10357db3fe6f836858066c44e740956ad3df61)
1196 | * Add dangling commas (356adb84c3d7c9ba937c4248a38e1d1cc6ba46df)
1197 | * Add a bunch of new rules (bf343f51cba2ae93bc38dff541122705776b2259)
1198 | * Make "no-undef" rule stricter (6ae63b3b83925ebdbcb1586f3292ef9cb93d8dc9)
1199 |
1200 | ### 9.0.0
1201 |
1202 | - **Breaking:** Enforce template-curly-spacing (see a3409a3613a58e002921db8cb54db0550fbfa56d)
1203 |
1204 | ### 8.0.0
1205 |
1206 | - **Breaking:** Add/change react rules based on discussion in [#5](https://github.com/peerigon/eslint-config-peerigon/issues/5)
1207 | - **Breaking:** Add rule to prevent curly spaces in template strings (see c600bd8b71094ee972b933762d646faef091376d)
1208 |
1209 | ### 7.0.0
1210 |
1211 | - Add new react rules
1212 |
1213 | ### 6.0.1
1214 |
1215 | - Fix parser silently switching back to es2015 when using the es5 rules
1216 |
1217 | ### 6.0.0
1218 |
1219 | - Update peer dependency eslint to ^3.0.0
1220 |
1221 | ### 5.1.0
1222 |
1223 | - Increase allowed max complexity
1224 |
1225 | ### 5.0.0
1226 |
1227 | - **Breaking:** Make eslint-plugin-jsdoc ^2.3.1 a peer dependency
1228 | - Add config for eslint-plugin-react
1229 |
1230 | ### 4.0.0
1231 |
1232 | - **Breaking:** Improve JSDoc validation (some rules are a bit stricter now)
1233 |
1234 | ### 3.1.1
1235 |
1236 | - Fix parser options for es6 and es5
1237 |
1238 | ### 3.1.0
1239 |
1240 | - Change severity of "arrow-parens" rule to 0
1241 |
1242 | ### 3.0.0
1243 |
1244 | - **Breaking:** Add rule "no-labels" with severity 2
1245 | - Update to eslint@^2.0.0
1246 | - Remove obsolete rules
1247 |
1248 | ### 2.0.0
1249 |
1250 | - **Breaking:** Change rule "quote-props" to "as-needed"
1251 | - Add mocha env to tests config
1252 |
1253 | ### 1.0.0
1254 |
1255 | - Add ES2015 rules
1256 | - Reached stable state :)
1257 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > [!WARNING]
2 | > This package is deprecated. Please switch to [@peerigon/configs](https://github.com/peerigon/configs).
3 |
4 | # eslint-config-peerigon
5 |
6 | **[Peerigon](https://peerigon.com/) coding rules as [ESLint](http://eslint.org/) config.**
7 |
8 | [](https://www.npmjs.com/package/eslint-config-peerigon)
9 | [](https://github.com/semantic-release/semantic-release)
10 | [](https://www.npmjs.com/package/eslint-config-peerigon)
11 | [](./LICENSE)
12 |
13 | Linting and formatting rules are always a balance between
14 |
15 | - ease of reading
16 | - ease of refactoring
17 | - ease of writing.
18 |
19 | We think that
20 |
21 | - code is read more often than refactored
22 | - and refactored more often than written from scratch.
23 |
24 | Our linting rules have been designed with these assumptions in mind.
25 |
26 | ## Table of contents
27 |
28 | - [Quick start](#quick-start)
29 | - [Practical guide](#practical-guide)
30 | - [Provided configs](#provided-configs)
31 | - [Styles](#styles)
32 |
33 | ## Quick start
34 |
35 | Recommended configuration in your `package.json`:
36 |
37 | ```js
38 | {
39 | "scripts": {
40 | "test:lint": "eslint --max-warnings 0 --cache --ext js,jsx,cjs,mjs,ts,tsx --ignore-path .gitignore .",
41 | "posttest": "npm run test:lint"
42 | }
43 | }
44 | ```
45 |
46 | We also offer a [Prettier](https://prettier.io/) config that matches our ESLint config. Create a `.prettierrc.json` in your project with the following content:
47 |
48 | ```json
49 | "eslint-config-peerigon/prettier.config.js"
50 | ```
51 |
52 | There are presets for the most common setups:
53 |
54 | ### TypeScript
55 |
56 | ```
57 | npm i eslint eslint-config-peerigon --save-dev
58 | ```
59 |
60 | ```js
61 | {
62 | "extends": [
63 | "peerigon/presets/typescript.js"
64 | ],
65 | "env": {
66 | "node": true
67 | },
68 | "root": true
69 | }
70 | ```
71 |
72 | ### TypeScript + React
73 |
74 | ```
75 | npm i eslint eslint-config-peerigon eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-react-hooks --save-dev
76 | ```
77 |
78 | ```js
79 | {
80 | "extends": [
81 | "peerigon/presets/typescript-react.js"
82 | ],
83 | "env": {
84 | "node": true,
85 | "browser": true
86 | },
87 | "root": true
88 | }
89 | ```
90 |
91 | ### TypeScript + Node
92 |
93 | ```
94 | npm i eslint eslint-config-peerigon eslint-plugin-n --save-dev
95 | ```
96 |
97 | ```js
98 | {
99 | "extends": [
100 | "peerigon/presets/typescript-node.js"
101 | ],
102 | "root": true
103 | }
104 | ```
105 |
106 | ## Practical guide
107 |
108 | ### Disabling rules
109 |
110 | Try to disable as less rules as possible. In most cases it's best to just write
111 |
112 | ```js
113 | // eslint-disable-next-line [rule-code]
114 | ```
115 |
116 | where `[rule-code]` is the code that is displayed along the error message. Disabling the next line is usually better because it resists [Prettier](https://prettier.io/) reformatting.
117 |
118 | Sometimes it makes sense to disable a rule within a specifc file. In that case you can put the following snippet at the beginning of the file:
119 |
120 | ```js
121 | /* eslint-disable [rule-code] */
122 | ```
123 |
124 | If you don't agree with a rule, please do not just disable the rule. Often there are good reasons and the current setting is the result of years of experience. It's better to create an issue here to start a discussion about the pros and cons of a rule.
125 |
126 | ### Different styles
127 |
128 | We acknowledge that there are certain rules where there are no actual pros and cons or where there is no clear winner. You just have to decide for one style and stick with it. We also know that some rules make sense in one project, but don't make sense in another project. That's why we also provide a list of [accepted custom styles](#styles) (see also [this discussion](https://github.com/peerigon/eslint-config-peerigon/issues/11)) which you can pick.
129 |
130 | ### VSCode
131 |
132 | This is our recommended VSCode configuration using the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). Adjust it to the needs of your particular project:
133 |
134 | ```json
135 | {
136 | "editor.defaultFormatter": "esbenp.prettier-vscode",
137 | "editor.formatOnSave": true,
138 | "editor.codeActionsOnSave": {
139 | "source.fixAll.eslint": true
140 | }
141 | }
142 | ```
143 |
144 | ### Experimental syntax using Babel
145 |
146 | If you're using Babel you should set [`requireConfigFile: true`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser#additional-parser-configuration) in your ESLint config. ESLint will then use your `babel.config.json`.
147 |
148 | ```js
149 | {
150 | "parserOptions": { "requireConfigFile": true },
151 | }
152 | ```
153 |
154 | ### Naming conventions for properties
155 |
156 | Sometimes we're not in full control over the naming conventions in our codebase, for instance if data is coming from a foreign API. While it often is preferable to transform property names into camelCase, it might not be practical. In these situations you can disable the check for properties like this:
157 |
158 | ```js
159 | const options = require("eslint-config-peerigon/options.js");
160 |
161 | module.exports = {
162 | /* ... */
163 | rules: {
164 | // The API uses snake_case as properties
165 | camelcase: [
166 | "warn",
167 | {
168 | ...options["camelcase"],
169 | properties: "never",
170 | },
171 | ],
172 | },
173 | };
174 | ```
175 |
176 | **In TypeScript projects:**
177 |
178 | ```js
179 | const options = require("eslint-config-peerigon/options.js");
180 |
181 | module.exports = {
182 | /* ... */
183 | rules: {
184 | // The API uses snake_case as properties
185 | "@typescript-eslint/naming-convention": [
186 | "warn",
187 | options["@typescript-eslint/naming-convention"].ignoreProperties,
188 | ...options["@typescript-eslint/naming-convention"].defaultRules,
189 | ],
190 | },
191 | };
192 | ```
193 |
194 | ## Provided configs
195 |
196 | ### [`peerigon`](base.js)
197 |
198 | **Base rules for every project. You should always add these rules.**
199 |
200 | ```
201 | npm i eslint eslint-config-peerigon --save-dev
202 | ```
203 |
204 | These rules assume a modern project with full ES2015 support, including ES modules. For specific environments like Node.js or old JS engines, see below. The base rules do not define an `env`, so you might want to do that for yourself to enable specific globals.
205 |
206 | Add an `.eslintrc.json` to the project's root folder:
207 |
208 | ```js
209 | {
210 | "extends": [
211 | // Base rules for every project
212 | "peerigon"
213 | ],
214 | // Do not search for further eslint configs in upper directories
215 | "root": true,
216 | // If you're using Babel, you should set requireConfigFile: true
217 | // ESLint will then use your babel.config.json.
218 | // "parserOptions": { "requireConfigFile": true },
219 | }
220 | ```
221 |
222 | The base rules use the `eslint-plugin-import` to resolve imports. Although it's possible to define [custom resolvers](https://github.com/benmosher/eslint-plugin-import#resolvers), it's highly discouraged to deviate from the common Node.js resolving algorithm. Other tools like linters and intellisense don't work reliably when you change the resolver.
223 |
224 | ### [`peerigon/typescript`](typescript.js)
225 |
226 | Rules for [TypeScript](https://www.typescriptlang.org/).
227 |
228 | ```js
229 | {
230 | "extends": [
231 | "peerigon",
232 | "peerigon/typescript",
233 | // Arrow functions are preferred with TypeScript
234 | // See https://github.com/peerigon/eslint-config-peerigon/issues/23#issuecomment-472614432
235 | "peerigon/styles/prefer-arrow"
236 | ],
237 | "root": true,
238 | }
239 | ```
240 |
241 | You need to add `--ext js,jsx,cjs,mjs,ts,tsx` to the `test:lint` script:
242 |
243 | ```js
244 | {
245 | "scripts": {
246 | "test:lint": "eslint --max-warnings 0 --cache --ext js,jsx,cjs,mjs,ts,tsx --ignore-path .gitignore ."
247 | }
248 | }
249 | ```
250 |
251 | _We recommend using [`peerigon/styles/prefer-arrow`](#peerigonstylesprefer-arrow) because arrow functions (or function expressions in general) can leverage [TypeScript's contextual typing](https://www.typescriptlang.org/docs/handbook/type-inference.html#contextual-typing)._
252 |
253 | ### [`peerigon/node`](node.js)
254 |
255 | **Important: Requires [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).**
256 |
257 | ```
258 | npm i eslint-plugin-n --save-dev
259 | ```
260 |
261 | ```js
262 | {
263 | "extends": [
264 | "peerigon",
265 | "peerigon/node"
266 | ],
267 | // Setting env.node = true is not necessary, this is already done by peerigon/node
268 | "root": true
269 | }
270 | ```
271 |
272 | ### [`peerigon/react`](react.js)
273 |
274 | **Important: Requires [`eslint-plugin-react`](https://github.com/yannickcr/eslint-plugin-react), [`eslint-plugin-jsx-a11y`](https://github.com/evcohen/eslint-plugin-jsx-a11y) and [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) as project dependency.**
275 |
276 | ```
277 | npm i eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-react-hooks --save-dev
278 | ```
279 |
280 | Rules for [React](https://facebook.github.io/react/) development, including accessibility rules.
281 | These rules are also applicable in other JSX environments, like [Preact](https://github.com/developit/preact):
282 |
283 | ```js
284 | {
285 | "extends": [
286 | "peerigon",
287 | "peerigon/react"
288 | ],
289 | "root": true
290 | }
291 | ```
292 |
293 | _We recommend using [`peerigon/styles/react-jsx-no-literals`](#peerigonstylesreact-jsx-no-literals) if you're using i18n in your project._
294 | _You can use [`peerigon/styles/react-jsx-no-bind`](#peerigonstylesreact-jsx-no-bind) if you're using `memo` and `shouldComponentUpdate` a lot._
295 |
296 | ### [`peerigon/jsdoc`](jsdoc.js)
297 |
298 | **Important: Requires [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) as project dependency.**
299 |
300 | ```
301 | npm i eslint-plugin-jsdoc --save-dev
302 | ```
303 |
304 | Makes sure that JSDoc annotations are written in a standard-compliant and uniform way.
305 |
306 | ```js
307 | {
308 | "extends": [
309 | "peerigon",
310 | "peerigon/jsdoc"
311 | ],
312 | "root": true
313 | }
314 | ```
315 |
316 | ## Styles
317 |
318 | The following rules enable specific writing styles. Use them as you prefer.
319 |
320 | ### [`peerigon/styles/prefer-arrow`](styles/prefer-arrow.js)
321 |
322 | Enforces arrow function expressions instead of function declarations (see [#23](https://github.com/peerigon/eslint-config-peerigon/issues/23)).
323 | Regular functions are still allowed as methods in objects or classes.
324 |
325 | ```js
326 | "extends": [
327 | "peerigon",
328 | "peerigon/styles/prefer-arrow"
329 | ],
330 | ```
331 |
332 | ### [`peerigon/styles/no-default-export`](styles/no-default-export.js)
333 |
334 | Forbids usage of `export default`. When using default exports, it becomes harder to name classes or functions consistently throughout the codebase since every module can pick its own name for the imported thing. Nicholas C. Zakas, the creator of ESLint, wrote [an article with more compelling arguments why he stopped using `export default`](https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/).
335 |
336 | ```js
337 | "extends": [
338 | "peerigon",
339 | "peerigon/styles/no-default-export"
340 | ],
341 | ```
342 |
343 | **Please note:** This rule is disabled in `.jsx` and `.tsx` files because React components are usually exported via `export default`. [`React.lazy`](https://reactjs.org/docs/code-splitting.html#reactlazy) even expects the lazy loaded component to be exported as `default`.
344 |
345 | ### [`peerigon/styles/no-null`](styles/no-null.js)
346 |
347 | **Important: Requires [`eslint-plugin-no-null`](https://github.com/nene/eslint-plugin-no-null) as project dependency.**
348 |
349 | ```
350 | npm i eslint-plugin-no-null --save-dev
351 | ```
352 |
353 | Forbids the usage of `null`. In a codebase it's often better to use a single non-value to represent _the absence of a value_. With the rise of default parameters and destructuring defaults, JavaScript developed a clear tendency towards `undefined`. [This issue](https://github.com/peerigon/eslint-config-peerigon/issues/71) summarizes the arguments (and trade-offs) of **null vs. undefined**.
354 |
355 | ```js
356 | "extends": [
357 | "peerigon",
358 | "peerigon/styles/no-null"
359 | ],
360 | ```
361 |
362 | **Please note:** If you use this rule, you will probably still need a single `null` value which you can refer to whenever you need to use `null` because of third-party code:
363 |
364 | ```js
365 | // eslint-disable-next-line no-null/no-null
366 | export const NULL = null;
367 | ```
368 |
369 | ### [`peerigon/styles/prefer-interface`](styles/prefer-interface.js)
370 |
371 | **Important: Use it in combination with [`peerigon/typescript`](typescript.js).**
372 |
373 | [Prefer `interface` over `type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-interface.md).
374 |
375 | ```js
376 | "extends": [
377 | "peerigon",
378 | "peerigon/typescript",
379 | "peerigon/styles/prefer-interface"
380 | ],
381 | ```
382 |
383 | ### [`peerigon/styles/react-jsx-no-bind`](styles/react-jsx-no-bind.js)
384 |
385 | **Important: Use it in combination with [`peerigon/react`](react.js).**
386 |
387 | Depending on the way you write your components, it might be not ok to create functions during `render()`. Use it if you're using things like `React.memo()` or `shouldComponentUpdate` a lot.
388 |
389 | ```js
390 | "extends": [
391 | "peerigon",
392 | "peerigon/react",
393 | "peerigon/styles/react-jsx-no-bind"
394 | ],
395 | ```
396 |
397 | ### [`peerigon/styles/react-jsx-no-literals`](styles/react-jsx-no-literals.js)
398 |
399 | **Important: Use it in combination with [`peerigon/react`](react.js).**
400 |
401 | Use this style if you're using i18n. It prevents people from putting raw strings in components.
402 |
403 | ```js
404 | "extends": [
405 | "peerigon",
406 | "peerigon/react",
407 | "peerigon/styles/react-jsx-no-literals"
408 | ],
409 | ```
410 |
411 | It disallows this:
412 |
413 | ```jsx
414 | const Hello = test
;
415 | ```
416 |
417 | As an escape hatch, this is still allowed:
418 |
419 | ```jsx
420 | const Hello = {"test"}
;
421 | ```
422 |
423 | ### [`peerigon/styles/prefer-array-shorthand`](styles/prefer-array-shorthand.js)
424 |
425 | **Important: Use it in combination with [`peerigon/typescript`](typescript.js).**
426 |
427 | Enforces typescript arrays to use the shorthand array-style instead of the generic style.
428 |
429 | ```js
430 | "extends": [
431 | "peerigon",
432 | "peerigon/typescript",
433 | "peerigon/styles/prefer-array-shorthand"
434 | ],
435 | ```
436 |
437 | It enforces this:
438 |
439 | ```ts
440 | const foo: string[] = [];
441 | ```
442 |
443 | instead of
444 |
445 | ```ts
446 | const foo: Array = [];
447 | ```
448 |
449 | ## License
450 |
451 | Unlicense
452 |
453 | ## Sponsors
454 |
455 | [
](https://peerigon.com)
456 |
--------------------------------------------------------------------------------
/base.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | const options = require("./options.js");
5 | const globPatterns = require("./glob-patterns.js");
6 | const tests = require("./tests.js");
7 | const configs = require("./configs.js");
8 |
9 | module.exports = {
10 | parser: "@babel/eslint-parser",
11 | env: {
12 | es6: true,
13 | },
14 | parserOptions: {
15 | sourceType: "module",
16 | ecmaVersion: "latest",
17 | // We don't require a Babel config file in our base rules since it would complain
18 | // for every regular JS file that the babel config is missing, even when Babel isn't used.
19 | // If experimental syntax is used, you can still set this to true.
20 | requireConfigFile: false,
21 | },
22 | plugins: [
23 | "@babel",
24 | "import",
25 | "optimize-regex",
26 | "promise",
27 | "no-unsafe-regex",
28 | ],
29 | extends: [
30 | "eslint:recommended",
31 | "plugin:import/errors",
32 | "plugin:import/warnings",
33 | "plugin:promise/recommended",
34 | ],
35 | reportUnusedDisableDirectives: true,
36 | rules: {
37 | /* eslint-enable sort-keys */
38 | "@babel/new-cap": "warn",
39 | "@babel/no-invalid-this": "warn",
40 | "@babel/no-unused-expressions": [
41 | "warn",
42 | options["no-unused-expressions"],
43 | ],
44 | "accessor-pairs": [
45 | "off",
46 | {
47 | getWithoutSet: true,
48 | },
49 | ], // http://eslint.org/docs/rules/accessor-pairs
50 | "array-callback-return": ["error"], // http://eslint.org/docs/rules/array-callback-return
51 | "arrow-body-style": "off", // http://eslint.org/docs/rules/arrow-body-style
52 | // https://github.com/babel/eslint-plugin-babel
53 | "block-scoped-var": "error", // http://eslint.org/docs/rules/block-scoped-varbrace-style
54 | camelcase: ["warn", options.camelcase], // http://eslint.org/docs/rules/camelcase
55 | "capitalized-comments": ["off"], // http://eslint.org/docs/rules/capitalized-comments
56 | "class-methods-use-this": ["off"], // http://eslint.org/docs/rules/class-methods-use-this
57 | complexity: [
58 | "off",
59 | {
60 | max: 12,
61 | },
62 | ], // http://eslint.org/docs/rules/complexity
63 | "consistent-return": "warn", // http://eslint.org/docs/rules/consistent-return
64 | "consistent-this": ["off", "self"], // http://eslint.org/docs/rules/consistent-this
65 | "constructor-super": "error", // http://eslint.org/docs/rules/constructor-super
66 | curly: ["warn", "all"], // http://eslint.org/docs/rules/curly
67 | "default-case": "off", // http://eslint.org/docs/rules/default-case
68 | "default-case-last": "off", // https://eslint.org/docs/rules/default-case-last
69 | "default-param-last": "off", // https://eslint.org/docs/rules/default-param-last
70 | // We don't support ES3 envs anymore, so allowKeywords: true is ok
71 | "dot-notation": ["warn", { allowKeywords: true }], // http://eslint.org/docs/rules/dot-notation
72 | eqeqeq: ["warn", "always", { null: "ignore" }], // http://eslint.org/docs/rules/eqeqeq
73 | "func-name-matching": ["off"], // http://eslint.org/docs/rules/func-name-matching
74 | "func-names": "off", // http://eslint.org/docs/rules/func-names
75 | "func-style": ["warn", "declaration"], // http://eslint.org/docs/rules/func-style
76 | "grouped-accessor-pairs": ["warn", "setBeforeGet"], // https://eslint.org/docs/rules/grouped-accessor-pairs
77 | "guard-for-in": "off", // http://eslint.org/docs/rules/guard-for-in
78 | "id-denylist": "off", // https://eslint.org/docs/rules/id-denylist
79 | "id-length": "off", // http://eslint.org/docs/rules/id-length
80 | "id-match": "off", // http://eslint.org/docs/rules/id-match
81 | "import/consistent-type-specifier-style": ["warn", "prefer-top-level"], // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md
82 | "import/dynamic-import-chunkname": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/dynamic-import-chunkname.md
83 | "import/exports-last": "off", // https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/exports-last.md
84 | "import/extensions": ["warn", "ignorePackages"], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/extensions.md
85 | "import/first": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
86 | "import/group-exports": "off", // https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/group-exports.md
87 | "import/max-dependencies": ["off", { max: 35 }], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
88 | // Is already covered by eslint rule padding-line-between-statements
89 | "import/newline-after-import": ["off", { count: 1 }], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
90 | "import/no-absolute-path": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
91 | "import/no-amd": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
92 | // The auto-import feature of VS Code (and probably other editors) cannot work when things are
93 | // exported anonymously because the editor does not know what the user wants to import.
94 | // By just allowing default exports with names, refactoring and auto-importing becomes easier.
95 | "import/no-anonymous-default-export": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-anonymous-default-export.md
96 | "import/no-commonjs": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
97 | // Currently disabled because of performance reasons :(
98 | "import/no-cycle": "off", // https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-cycle.md
99 | "import/no-default-export": "off", // https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-default-export.md
100 | // Would be nice to turn this rule on but it's rather expensive
101 | // and it did not report a lot in the past :(
102 | "import/no-deprecated": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
103 | "import/no-duplicates": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
104 | "import/no-dynamic-require": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
105 | "import/no-empty-named-blocks": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-empty-named-blocks.md
106 | "import/no-extraneous-dependencies": [
107 | "off",
108 | {
109 | devDependencies: globPatterns.tests.concat(
110 | globPatterns.tooling,
111 | ),
112 | optionalDependencies: true,
113 | peerDependencies: false,
114 | },
115 | ], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
116 | "import/no-import-module-exports": "error", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md
117 | "import/no-internal-modules": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
118 | "import/no-mutable-exports": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
119 | "import/no-named-default": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
120 | "import/no-named-export": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-export.md
121 | "import/no-namespace": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
122 | "import/no-nodejs-modules": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
123 | "import/no-relative-packages": "error", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md
124 | "import/no-relative-parent-imports": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-parent-imports.md
125 | "import/no-restricted-paths": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
126 | "import/no-self-import": "error", // https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-self-import.md
127 | // While unassigned imports are often a bad choice, the false positive rate was just too high
128 | "import/no-unassigned-import": [
129 | "off",
130 | {
131 | allow: globPatterns.withSideEffects,
132 | },
133 | ], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
134 | "import/no-unresolved": ["error", { commonjs: true }], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
135 | "import/no-unused-modules": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unused-modules.md
136 | "import/no-useless-path-segments": "warn", // currently undocumented :(, see https://github.com/import-js/eslint-plugin-import/issues/1032
137 | "import/no-webpack-loader-syntax": "warn", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
138 | "import/order": [
139 | "warn",
140 | {
141 | // Since we want to keep changes as small as possible we can't order "parent", "sibling" and "index".
142 | // Otherwise moving a file from one folder to another might impact a lot of files because
143 | // now all the import statements need to be updated.
144 | groups: ["builtin", "external", ["parent", "sibling", "index"]],
145 | },
146 | ], // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md
147 | "import/prefer-default-export": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
148 | // This rule was just too impractical since code bases often mix commonjs modules and ecmascript modules
149 | "import/unambiguous": "off", // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
150 | "init-declarations": "off", // http://eslint.org/docs/rules/init-declarations
151 |
152 | "line-comment-position": "off", // http://eslint.org/docs/rules/line-comment-position
153 | // We don't want to enforce these operators for now as they are hard to read
154 | // This might change later though :)
155 | "logical-assignment-operators": ["off", "always"], // http://eslint.org/docs/rules/logical-assignment-operators
156 | "max-classes-per-file": "off", // https://eslint.org/docs/rules/max-classes-per-file
157 | "max-depth": ["warn", 5], // http://eslint.org/docs/rules/max-depth
158 | "max-lines": ["off", options["max-lines"]],
159 | "max-lines-per-function": "off", // https://eslint.org/docs/rules/max-lines-per-function
160 | "max-nested-callbacks": ["warn", 3], // http://eslint.org/docs/rules/max-nested-callbacks
161 | "max-params": ["warn", { max: 4 }], // http://eslint.org/docs/rules/max-params
162 | "max-statements": "off", // http://eslint.org/docs/rules/max-statements
163 | "multiline-comment-style": "off", // https://eslint.org/docs/rules/multiline-comment-style
164 | // Handled by babel/new-cap
165 | "new-cap": "off", // http://eslint.org/docs/rules/new-cap
166 | "no-alert": "warn", // http://eslint.org/docs/rules/no-alert
167 | "no-array-constructor": "warn", // http://eslint.org/docs/rules/no-array-constructor
168 | "no-await-in-loop": "warn", // http://eslint.org/docs/rules/no-await-in-loop
169 | "no-bitwise": "warn", // http://eslint.org/docs/rules/no-bitwise
170 | "no-caller": "warn", // http://eslint.org/docs/rules/no-caller
171 | "no-case-declarations": "warn", // http://eslint.org/docs/rules/no-case-declarations
172 | "no-class-assign": "warn", // http://eslint.org/docs/rules/no-class-assign
173 | "no-console": "off", // http://eslint.org/docs/rules/no-console
174 | "no-constant-condition": [
175 | "error", // "error" because this is part of "eslint:recommended"
176 | {
177 | // while (true) loops are pretty common
178 | checkLoops: false,
179 | },
180 | ], // http://eslint.org/docs/rules/no-constant-condition
181 | "no-constant-binary-expression": "warn", // http://eslint.org/docs/rules/no-constant-binary-expression
182 | "no-constructor-return": "warn", // https://eslint.org/docs/rules/no-constructor-return
183 | "no-continue": "off", // http://eslint.org/docs/rules/no-continue
184 | "no-delete-var": "warn", // http://eslint.org/docs/rules/no-delete-var
185 | "no-div-regex": "off", // http://eslint.org/docs/rules/no-div-regex
186 | "no-dupe-class-members": "warn", // http://eslint.org/docs/rules/no-dupe-class-members
187 | "no-dupe-else-if": "warn", // https://eslint.org/docs/rules/no-dupe-else-if
188 | // handled by import/no-duplicates
189 | "no-duplicate-imports": "off", // http://eslint.org/docs/rules/no-duplicate-imports
190 | "no-else-return": "warn", // http://eslint.org/docs/rules/no-else-return
191 | "no-empty": "warn", // http://eslint.org/docs/rules/no-empty
192 | "no-empty-function": "off", // http://eslint.org/docs/rules/no-empty-function
193 | "no-empty-pattern": "warn", // http://eslint.org/docs/rules/no-empty-pattern
194 | "no-empty-static-block": "warn", // http://eslint.org/docs/rules/no-empty-static-block
195 | "no-eq-null": "off", // http://eslint.org/docs/rules/no-eq-null
196 | "no-eval": "warn", // http://eslint.org/docs/rules/no-eval
197 | "no-extend-native": "warn", // http://eslint.org/docs/rules/no-extend-native
198 | "no-extra-bind": "warn", // http://eslint.org/docs/rules/no-extra-bind
199 | "no-extra-label": "warn", // http://eslint.org/docs/rules/no-extra-label
200 | "no-fallthrough": "warn", // http://eslint.org/docs/rules/no-fallthrough
201 | "no-global-assign": "warn", // http://eslint.org/docs/rules/no-global-assign
202 | "no-implicit-coercion": "warn", // http://eslint.org/docs/rules/no-implicit-coercion
203 | "no-implicit-globals": "warn", // http://eslint.org/docs/rules/no-implicit-globals
204 | "no-implied-eval": "warn", // http://eslint.org/docs/rules/no-implied-eval
205 | "no-import-assign": "warn", // https://eslint.org/docs/rules/no-import-assign
206 | "no-inline-comments": "off", // http://eslint.org/docs/rules/no-inline-comments
207 | // Handled by babel/no-invalid-this
208 | "no-invalid-this": "off", // http://eslint.org/docs/rules/no-invalid-this
209 | "no-iterator": "warn", // http://eslint.org/docs/rules/no-iterator
210 | "no-label-var": "warn", // http://eslint.org/docs/rules/no-label-var
211 | "no-labels": "warn", // http://eslint.org/docs/rules/no-labels
212 | "no-lone-blocks": "warn", // http://eslint.org/docs/rules/no-lone-blocks
213 | // Lonely ifs can sometimes be a stylistic choice when the nested condition
214 | // is completely unrelated to the first condition
215 | "no-lonely-if": "off", // http://eslint.org/docs/rules/no-lonely-if
216 | // With let and const this is not an issue anymore
217 | "no-loop-func": "off", // http://eslint.org/docs/rules/no-loop-func
218 | "no-loss-of-precision": "error", // https://eslint.org/docs/rules/no-loss-of-precision
219 | "no-magic-numbers": [
220 | "off",
221 | {
222 | // These settings are currently unused, but we may re-use them once we decide to have that rule again.
223 | ignore: [
224 | // digits are ok
225 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
226 | // multiplications of 10
227 | -1, -10, -100, -1000, 10, 100, 1000,
228 | // bytes
229 | 16, 32, 64, 128, 256, 512, 1024,
230 | // time
231 | 60, 24, 365,
232 | // ports
233 | 80, 443, 1337, 3000, 8080,
234 | ],
235 | ignoreArrayIndexes: true, // using array indexes is not a good style, but we don't want to be too strict about that
236 | },
237 | ], // http://eslint.org/docs/rules/no-magic-numbers
238 | "no-multi-assign": "off", // http://eslint.org/docs/rules/no-multi-assign
239 | "no-multi-str": "warn", // http://eslint.org/docs/rules/no-multi-str
240 | "no-negated-condition": "warn", // http://eslint.org/docs/rules/no-negated-condition
241 | "no-nested-ternary": "off", // http://eslint.org/docs/rules/no-nested-ternary
242 | "no-new": "warn", // http://eslint.org/docs/rules/no-new
243 | "no-new-func": "warn", // http://eslint.org/docs/rules/no-new-func
244 | "no-new-native-nonconstructor": "warn", // http://eslint.org/docs/rules/no-new-native-nonconstructor
245 | "no-new-symbol": "warn", // http://eslint.org/docs/rules/no-new-symbol
246 | "no-new-wrappers": "warn", // http://eslint.org/docs/rules/no-new-wrappers
247 | "no-nonoctal-decimal-escape": "error", // http://eslint.org/docs/rules/no-nonoctal-decimal-escape
248 | "no-object-constructor": "warn", // http://eslint.org/docs/rules/no-object-constructor
249 | "no-octal": "warn", // http://eslint.org/docs/rules/no-octal
250 | "no-octal-escape": "warn", // http://eslint.org/docs/rules/no-octal-escape
251 | "no-param-reassign": "off", // http://eslint.org/docs/rules/no-param-reassign
252 | "no-plusplus": "off", // http://eslint.org/docs/rules/no-plusplus
253 | // The rule reported
254 | // await new Promise((resolve) => setTimeout(resolve, 0))
255 | // which is pretty common.
256 | // Maybe there's an exception for one-liners now?
257 | "no-promise-executor-return": "off", // http://eslint.org/docs/rules/no-promise-executor-return
258 | "no-proto": "warn", // http://eslint.org/docs/rules/no-proto
259 | "no-redeclare": "warn", // http://eslint.org/docs/rules/no-redeclare
260 | "no-restricted-exports": [
261 | "warn",
262 | {
263 | restrictedNamedExports: [
264 | // If "then" is a function, the module will not be loadedable by an async import()
265 | // because it looks like a promise. The JS engine will call the .then() function in that case
266 | // Since this is super confusing, let's warn the user about it
267 | "then",
268 | ],
269 | },
270 | ], // http://eslint.org/docs/rules/no-restricted-exports
271 | "no-restricted-globals": ["warn", "event"], // http://eslint.org/docs/rules/no-restricted-globals
272 | "no-restricted-imports": "off", // http://eslint.org/docs/rules/no-restricted-imports
273 | "no-restricted-properties": "off", // http://eslint.org/docs/rules/no-restricted-properties
274 | "no-restricted-syntax": ["warn", "WithStatement"], // http://eslint.org/docs/rules/no-restricted-syntax
275 | "no-return-assign": ["warn", "except-parens"], // http://eslint.org/docs/rules/no-return-assign
276 | // We actually want a rule that enforces to *always use return await*.
277 | // Reasoning: Putting try/catch around a return without await is a footgun.
278 | // try {
279 | // return somethingAsync();
280 | // } catch (error) { <-- will never be caught
281 | // }
282 | // Further discussions:
283 | // - https://github.com/eslint/eslint/issues/12246
284 | // - https://github.com/standard/eslint-config-standard-with-typescript/pull/206
285 | // - https://github.com/typescript-eslint/typescript-eslint/issues/1378
286 | "no-script-url": "warn", // http://eslint.org/docs/rules/no-script-url
287 | "no-self-assign": "warn", // http://eslint.org/docs/rules/no-self-assign
288 | "no-self-compare": "warn", // http://eslint.org/docs/rules/no-self-compare
289 | "no-sequences": "warn", // http://eslint.org/docs/rules/no-sequences
290 | "no-setter-return": "warn", // https://eslint.org/docs/rules/no-setter-return
291 | "no-shadow": "off", // http://eslint.org/docs/rules/no-shadow
292 | "no-shadow-restricted-names": "warn", // http://eslint.org/docs/rules/no-shadow-restricted-names
293 | "no-template-curly-in-string": "warn", // http://eslint.org/docs/rules/no-template-curly-in-string
294 | "no-ternary": "off", // eslint.org/docs/rules/no-ternary
295 | "no-this-before-super": "warn", // http://eslint.org/docs/rules/no-this-before-super
296 | "no-throw-literal": "warn", // http://eslint.org/docs/rules/no-throw-literal
297 | "no-undef": [
298 | "warn",
299 | {
300 | typeof: false,
301 | },
302 | ], // http://eslint.org/docs/rules/no-undef
303 | "no-undef-init": "warn", // http://eslint.org/docs/rules/no-undef-init
304 | // Since we disallow shadowing of undefined, it is safe to turn this rule off
305 | "no-undefined": "off", // http://eslint.org/docs/rules/no-undefined
306 | "no-underscore-dangle": "off", // http://eslint.org/docs/rules/no-underscore-dangle
307 | "no-unexpected-multiline": "warn", // http://eslint.org/docs/rules/no-unexpected-multiline
308 | "no-unmodified-loop-condition": "warn", // http://eslint.org/docs/rules/no-unmodified-loop-condition
309 | "no-unneeded-ternary": "warn", // http://eslint.org/docs/rules/no-unneeded-ternary
310 | "no-unreachable-loop": "warn", // http://eslint.org/docs/rules/no-unreachable-loop
311 | "no-unsafe-optional-chaining": "error", // http://eslint.org/docs/rules/no-unsafe-optional-chaining
312 | "no-unsafe-regex/no-unsafe-regex": "warn", // https://github.com/kgryte/eslint-plugin-no-unsafe-regex
313 | // Handled by babel/no-unused-expressions
314 | "no-unused-expressions": ["off", options["no-unused-expressions"]], // http://eslint.org/docs/rules/no-unused-expressions
315 | "no-unused-labels": "warn", // http://eslint.org/docs/rules/no-unused-labels
316 | "no-unused-private-class-members": "warn", // http://eslint.org/docs/rules/no-unused-private-class-members
317 | "no-unused-vars": ["warn", options["no-unused-vars"]], // http://eslint.org/docs/rules/no-unused-vars
318 | "no-use-before-define": "off", // http://eslint.org/docs/rules/no-use-before-define
319 | "no-useless-backreference": "error", // http://eslint.org/docs/rules/no-useless-backreference
320 | "no-useless-call": "warn", // http://eslint.org/docs/rules/no-useless-call
321 | "no-useless-computed-key": "warn", // http://eslint.org/docs/rules/no-useless-computed-key
322 | "no-useless-concat": "warn", // http://eslint.org/docs/rules/no-useless-concat
323 | "no-useless-constructor": "warn", // http://eslint.org/docs/rules/no-useless-constructor
324 | "no-useless-escape": "warn", // http://eslint.org/docs/rules/no-useless-escape
325 | "no-useless-rename": "warn", // http://eslint.org/docs/rules/no-useless-rename
326 | "no-useless-return": "warn", // http://eslint.org/docs/rules/no-useless-return
327 | "no-var": "warn", // http://eslint.org/docs/rules/no-var
328 | "no-void": "off", // http://eslint.org/docs/rules/no-void
329 | "no-warning-comments": [
330 | "off",
331 | {
332 | location: "anywhere",
333 | terms: ["todo", "fixme", "quickfix"],
334 | },
335 | ], // http://eslint.org/docs/rules/no-warning-comments
336 | "no-with": "warn", // http://eslint.org/docs/rules/no-with
337 | "object-shorthand": ["warn", "always"], // http://eslint.org/docs/rules/object-shorthand
338 | "one-var": ["warn", "never"], // http://eslint.org/docs/rules/one-var
339 | "operator-assignment": ["off", "always"], // http://eslint.org/docs/rules/operator-assignment
340 | "optimize-regex/optimize-regex": "warn",
341 | "prefer-arrow-callback": "warn", // http://eslint.org/docs/rules/prefer-arrow-callback
342 | "prefer-const": "warn", // http://eslint.org/docs/rules/prefer-const
343 | "prefer-destructuring": "off", // http://eslint.org/docs/rules/prefer-destructuring
344 | "prefer-exponentiation-operator": "warn", // https://eslint.org/docs/rules/prefer-exponentiation-operator
345 | "prefer-named-capture-group": "off", // https://eslint.org/docs/rules/prefer-named-capture-group
346 | "prefer-numeric-literals": "warn", // http://eslint.org/docs/rules/prefer-numeric-literals
347 | "prefer-object-has-own": "warn", // https://eslint.org/docs/rules/prefer-object-has-own
348 | "prefer-object-spread": "off", // https://eslint.org/docs/rules/prefer-object-spread
349 | "prefer-promise-reject-errors": "warn", // http://eslint.org/docs/rules/prefer-promise-reject-errors
350 | "prefer-regex-literals": "warn", // https://eslint.org/docs/rules/prefer-regex-literals
351 | "prefer-rest-params": "warn", // http://eslint.org/docs/rules/prefer-rest-params
352 | "prefer-spread": "warn", // http://eslint.org/docs/rules/prefer-spread
353 | // Using regular string concatentation can sometimes be easier to read
354 | // We leave it up to the developer to decide
355 | "prefer-template": "off", // http://eslint.org/docs/rules/prefer-template
356 | "promise/always-return": "off", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/always-return.md
357 | "promise/avoid-new": "off", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/avoid-new.md
358 | "promise/catch-or-return": ["off", { allowFinally: true }], // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/catch-or-return.md
359 | "promise/no-callback-in-promise": "warn", // https://github.com/xjamundx/eslint-plugin-promise
360 | "promise/no-multiple-resolved": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-multiple-resolved.md
361 | "promise/no-native": "off", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-native.md
362 | // Nesting is rarely necessary and often the sign of confusing code.
363 | // You can often simplify it, see https://github.com/xjamundx/eslint-plugin-promise/issues/42
364 | // In rare cases where nesting is desired, disable this rule.
365 | "promise/no-nesting": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-nesting.md
366 | "promise/no-new-statics": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-new-statics.md
367 | "promise/no-promise-in-callback": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-promise-in-callback.md
368 | "promise/no-return-in-finally": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-return-in-finally.md
369 | "promise/no-return-wrap": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/no-return-wrap.md
370 | "promise/param-names": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/param-names.md
371 | "promise/prefer-await-to-callbacks": "off", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/prefer-await-to-callbacks.md
372 | "promise/prefer-await-to-then": "off", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/prefer-await-to-then.md
373 | "promise/valid-params": "warn", // https://github.com/xjamundx/eslint-plugin-promise/blob/master/docs/rules/valid-params.md
374 | radix: "off", // http://eslint.org/docs/rules/radix
375 | // This rule would be nice but there are too many false positives :(
376 | "require-atomic-updates": "off", // https://eslint.org/docs/rules/require-atomic-updates
377 | "require-await": "off", // http://eslint.org/docs/rules/require-await
378 | // We would like to use this rule but there is currently a bug that would show
379 | // an ESLint error at a lot of RegExp, like /\./u
380 | // See https://github.com/DmitrySoshnikov/regexp-tree/issues/162
381 | // TODO: Enables this rule once the issue gets addressed
382 | "require-unicode-regexp": "off", // https://eslint.org/docs/rules/require-unicode-regexp
383 | "require-yield": "off", // http://eslint.org/docs/rules/require-yield
384 | // Handled by babel/semi
385 | semi: "off", // http://eslint.org/docs/rules/semisemi-style
386 | "sort-imports": "off", // http://eslint.org/docs/rules/sort-imports
387 | "sort-keys": "off", // http://eslint.org/docs/rules/sort-keys
388 | "sort-vars": "off", // http://eslint.org/docs/rules/sort-vars
389 | strict: "warn", // http://eslint.org/docs/rules/strict
390 | "symbol-description": "warn", // http://eslint.org/docs/rules/symbol-description
391 | "unicode-bom": ["warn", "never"], // http://eslint.org/docs/rules/unicode-bom
392 | "valid-typeof": "error", // http://eslint.org/docs/rules/valid-typeof
393 | "vars-on-top": "warn", // http://eslint.org/docs/rules/vars-on-top
394 | yoda: ["warn", "never"], // http://eslint.org/docs/rules/yoda
395 | /* eslint-disable sort-keys */
396 | },
397 | overrides: [
398 | {
399 | files: globPatterns.tests,
400 | ...tests,
401 | },
402 | {
403 | files: globPatterns.configs,
404 | ...configs,
405 | },
406 | ],
407 | };
408 |
--------------------------------------------------------------------------------
/configs.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | env: {
6 | node: true,
7 | },
8 | rules: {
9 | // Config files are usually not imported anywhere else so this is fine
10 | "import/no-anonymous-default-export": "off",
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/glob-patterns.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | module.exports = {
4 | tests: ["**/*.{test,spec,stories}.*", "**/test{s,}/**"],
5 | tooling: [
6 | "config/**",
7 | "script{,s}/**", // contains usually npm scripts
8 | "tool{,s}/**", // often used for other scripts
9 | ],
10 | withSideEffects: [
11 | "**/*.css",
12 | "**/*.less",
13 | "**/*.scss",
14 | "**/*.sass",
15 | "**/*register",
16 | "**/*extend", // mostly because of @testing-library/jest-dom/extend-expect
17 | ],
18 | typescript: ["*.ts", "*.tsx"],
19 | react: ["*.jsx", "*.tsx"],
20 | configs: ["*.config.*"],
21 | };
22 |
--------------------------------------------------------------------------------
/jsdoc.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["jsdoc"],
6 | overrides: [
7 | {
8 | files: "*.ts{,x}",
9 | rules: {
10 | "jsdoc/no-types": "warn", // JSDoc types are not necessary when using TypeScript
11 | "jsdoc/require-param": "off",
12 | "jsdoc/require-param-type": "off",
13 | "jsdoc/require-returns": "off",
14 | "jsdoc/require-returns-type": "off",
15 | },
16 | },
17 | ],
18 | rules: {
19 | // https://github.com/gajus/eslint-plugin-jsdoc/blob/master/README.md
20 | "jsdoc/check-access": "warn",
21 | "jsdoc/check-alignment": "warn",
22 | "jsdoc/check-examples": "warn",
23 | "jsdoc/check-indentation": "warn",
24 | "jsdoc/check-param-names": "warn",
25 | "jsdoc/check-property-names": "warn",
26 | "jsdoc/check-syntax": "off",
27 | "jsdoc/check-tag-names": [
28 | "warn",
29 | {
30 | definedTags: ["swagger"],
31 | },
32 | ],
33 | "jsdoc/check-types": "warn",
34 | "jsdoc/check-values": "off",
35 | "jsdoc/empty-tags": "warn",
36 | "jsdoc/implements-on-classes": "off",
37 | "jsdoc/match-description": "off",
38 | "jsdoc/newline-after-description": "warn",
39 | "jsdoc/no-bad-blocks": "warn",
40 | "jsdoc/no-defaults": "warn",
41 | "jsdoc/no-types": "off",
42 | "jsdoc/no-undefined-types": "warn",
43 | "jsdoc/require-description": "off",
44 | "jsdoc/require-description-complete-sentence": "off",
45 | "jsdoc/require-example": "off",
46 | "jsdoc/require-file-overview": "off",
47 | "jsdoc/require-hyphen-before-param-description": "warn",
48 | "jsdoc/require-jsdoc": "off",
49 | "jsdoc/require-param": "warn",
50 | "jsdoc/require-param-description": "off",
51 | "jsdoc/require-param-name": "off",
52 | "jsdoc/require-param-type": "warn",
53 | "jsdoc/require-property": "off",
54 | "jsdoc/require-property-description": "off",
55 | "jsdoc/require-property-name": "warn",
56 | "jsdoc/require-property-type": "warn",
57 | "jsdoc/require-returns": "warn",
58 | "jsdoc/require-returns-check": "warn",
59 | "jsdoc/require-returns-description": "off",
60 | "jsdoc/require-returns-type": "warn",
61 | "jsdoc/valid-types": "warn",
62 | },
63 | };
64 |
--------------------------------------------------------------------------------
/node.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["node"],
6 | extends: ["plugin:n/recommended"],
7 | env: {
8 | node: true,
9 | },
10 | parserOptions: {
11 | // Most Node projects don't use Babel to preprocess JS files
12 | // Requiring them would be annoying
13 | requireConfigFile: false,
14 | },
15 | rules: {
16 | /* eslint-enable sort-keys */
17 | "n/callback-return": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/callback-return.md
18 | "n/global-require": "off", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/global-require.md
19 | "n/handle-callback-err": ["warn", "^(err|error)$"], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/handle-callback-err
20 | "n/no-mixed-requires": [
21 | "warn",
22 | {
23 | allowCall: true,
24 | grouping: false,
25 | },
26 | ], // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-mixed-requires.md
27 | "n/no-new-require": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-new-require.md
28 | "n/no-path-concat": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-path-concat.md
29 | // process.exit() is often used in situations where it would have been better to either throw an error or
30 | // let the process exit by itself.
31 | // There are situations where process.exit() is the cause of truncated stdout output,
32 | // see https://nodejs.org/api/process.html#process_process_exit_code
33 | // If you want to set the exit code, you can also use process.exitCode.
34 | // Disable this rule if you have to exit the process forcefully and you know what you're doing.
35 | "n/no-process-exit": "warn", // https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
36 | /* eslint-disable sort-keys */
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/options.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const camelcase = {
4 | allow: ["^UNSAFE_"], // Allows React UNSAFE_ methods
5 | ignoreDestructuring: false,
6 | properties: "always",
7 | };
8 |
9 | module.exports = {
10 | /* eslint-enable sort-keys */
11 | ["camelcase"]: camelcase,
12 | ["max-lines"]: {
13 | max: 700,
14 | skipBlankLines: true,
15 | skipComments: true,
16 | },
17 | ["no-unused-expressions"]: {
18 | allowShortCircuit: true,
19 | allowTernary: true,
20 | },
21 | ["no-unused-vars"]: {
22 | // Sometimes you want to keep the function parameters for future usage
23 | args: "none",
24 | // Handling errors doesn't always mean that you need to use the error
25 | caughtErrors: "none",
26 | // This pattern is pretty common
27 | ignoreRestSiblings: true,
28 | vars: "all",
29 | },
30 | ["@typescript-eslint/ban-types"]: {
31 | types: {
32 | // Default options taken from https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/rules/ban-types.ts
33 | String: {
34 | message: "Use string instead",
35 | fixWith: "string",
36 | },
37 | Boolean: {
38 | message: "Use boolean instead",
39 | fixWith: "boolean",
40 | },
41 | Number: {
42 | message: "Use number instead",
43 | fixWith: "number",
44 | },
45 | Object: {
46 | message: "Use Record instead",
47 | fixWith: "Record",
48 | },
49 | Symbol: {
50 | message: "Use symbol instead",
51 | fixWith: "symbol",
52 | },
53 | },
54 | },
55 | ["@typescript-eslint/camelcase"]: {
56 | ...camelcase,
57 | genericType: "always",
58 | },
59 | ["@typescript-eslint/naming-convention"]: (() => {
60 | const options = {
61 | default: {
62 | selector: "default",
63 | format: ["camelCase", "PascalCase", "UPPER_CASE"],
64 | leadingUnderscore: "allow",
65 | trailingUnderscore: "allow",
66 | },
67 | function: {
68 | selector: "function",
69 | format: ["camelCase"],
70 | leadingUnderscore: "allow",
71 | trailingUnderscore: "allow",
72 | },
73 | parameter: {
74 | selector: "parameter",
75 | format: ["camelCase", "PascalCase"],
76 | leadingUnderscore: "allow",
77 | trailingUnderscore: "allow",
78 | },
79 | method: {
80 | selector: "method",
81 | format: ["camelCase"],
82 | leadingUnderscore: "allow",
83 | trailingUnderscore: "allow",
84 | },
85 | typeLike: {
86 | selector: "typeLike",
87 | format: ["PascalCase"],
88 | leadingUnderscore: "allow",
89 | trailingUnderscore: "allow",
90 | },
91 | enumMember: {
92 | selector: "enumMember",
93 | format: ["PascalCase"],
94 | leadingUnderscore: "allow",
95 | trailingUnderscore: "allow",
96 | },
97 | // In case it's destructured, we don't want to force the developer to change the casing
98 | destructuring: {
99 | selector: "variable",
100 | modifiers: ["destructured"],
101 | format: null,
102 | },
103 | // In case the property name requires quotes, we don't enforce any convention
104 | requiresQuites: {
105 | selector: [
106 | "classProperty",
107 | "objectLiteralProperty",
108 | "typeProperty",
109 | "classMethod",
110 | "objectLiteralMethod",
111 | "typeMethod",
112 | "accessor",
113 | "enumMember",
114 | ],
115 | modifiers: ["requiresQuotes"],
116 | format: null,
117 | },
118 | // We don't enforce any convention on object literals since these are often used
119 | // for data object where we're not in control of the type (e.g. an api that takes camel_case properties)
120 | objectLiteralProperty: {
121 | selector: "objectLiteralProperty",
122 | format: null,
123 | },
124 | };
125 |
126 | // By enumerating all selectors explicitly we increase the
127 | // specificity of these rules.
128 | const escapeHatches = [
129 | "variable",
130 | "function",
131 | "parameter",
132 | "property",
133 | "parameterProperty",
134 | "method",
135 | "accessor",
136 | "enumMember",
137 | "class",
138 | "interface",
139 | "typeAlias",
140 | "enum",
141 | "typeParameter",
142 | ].map((selector) => ({
143 | filter: {
144 | match: true,
145 | // UNSAFE_ is a prefix used by React for all lifecycle hooks that are about to be deprecated
146 | regex: "^(__|UNSAFE_).+$",
147 | },
148 | format: null,
149 | selector,
150 | }));
151 |
152 | options.defaultRules = [...Object.values(options), ...escapeHatches];
153 |
154 | options.ignoreProperties = {
155 | selector: "property",
156 | format: null,
157 | };
158 |
159 | return options;
160 | })(),
161 | /* eslint-disable sort-keys */
162 | };
163 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eslint-config-peerigon",
3 | "version": "0.0.0-semantically-released",
4 | "description": "Peerigon coding rules as eslint config",
5 | "main": "base.js",
6 | "scripts": {
7 | "unused": "eslint-find-rules -u -n -d",
8 | "unused:javascript": "npm run unused -- ./tests/javascript/.eslintrc.json",
9 | "unused:typescript": "npm run unused -- --ext .ts ./tests/typescript/.eslintrc.json",
10 | "unused:react": "npm run unused -- --ext .ts ./tests/react/.eslintrc.json",
11 | "rsync": "rsync -a --include=\"*.js\" --exclude=\".git\" --exclude=\"node_modules\" .",
12 | "test": "run-p test:*",
13 | "test:javascript": "cd tests/javascript; eslint --max-warnings 0 .",
14 | "test:node": "cd tests/node; eslint --max-warnings 0 .",
15 | "test:typescript": "cd tests/typescript; eslint --max-warnings 0 .",
16 | "test:react": "cd tests/react; eslint --max-warnings 0 .",
17 | "test:prettier": "prettier --check .",
18 | "prepare": "husky",
19 | "release": "semantic-release"
20 | },
21 | "repository": {
22 | "type": "git",
23 | "url": "https://github.com/peerigon/eslint-config-peerigon.git"
24 | },
25 | "keywords": [
26 | "eslint",
27 | "peerigon",
28 | "coding",
29 | "rules",
30 | "style"
31 | ],
32 | "files": [
33 | "*.js",
34 | "styles",
35 | "presets"
36 | ],
37 | "author": "Peerigon GmbH ",
38 | "license": "Unlicense",
39 | "bugs": {
40 | "url": "https://github.com/peerigon/eslint-config-peerigon/issues"
41 | },
42 | "homepage": "https://github.com/peerigon/eslint-config-peerigon#readme",
43 | "peerDependencies": {
44 | "eslint": "^8.1.0"
45 | },
46 | "dependencies": {
47 | "@babel/core": "^7.24.9",
48 | "@babel/eslint-parser": "^7.24.8",
49 | "@babel/eslint-plugin": "^7.24.7",
50 | "@ianvs/prettier-plugin-sort-imports": "^4.3.1",
51 | "@typescript-eslint/eslint-plugin": "^7.16.1",
52 | "@typescript-eslint/parser": "^7.16.1",
53 | "eslint-config-prettier": "^9.1.0",
54 | "eslint-plugin-import": "^2.29.1",
55 | "eslint-plugin-no-unsafe-regex": "^1.0.0",
56 | "eslint-plugin-optimize-regex": "^1.2.1",
57 | "eslint-plugin-prefer-arrow": "^1.2.3",
58 | "eslint-plugin-promise": "^6.5.1"
59 | },
60 | "devDependencies": {
61 | "@babel/plugin-proposal-class-properties": "^7.18.6",
62 | "@babel/plugin-syntax-import-attributes": "^7.24.7",
63 | "@babel/preset-env": "^7.24.8",
64 | "@semantic-release/changelog": "^6.0.3",
65 | "@semantic-release/git": "^10.0.1",
66 | "@types/react": "^18.3.3",
67 | "eslint": "^8.57.0",
68 | "eslint-find-rules": "^4.1.0",
69 | "eslint-plugin-jsx-a11y": "^6.9.0",
70 | "eslint-plugin-n": "^17.9.0",
71 | "eslint-plugin-node": "^11.1.0",
72 | "eslint-plugin-react": "^7.35.0",
73 | "eslint-plugin-react-hooks": "^4.6.2",
74 | "husky": "^9.1.1",
75 | "lint-staged": "^15.2.7",
76 | "npm-run-all": "^4.1.5",
77 | "pin-github-action": "^1.9.1",
78 | "prettier": "^3.3.3",
79 | "react": "^18.3.1",
80 | "semantic-release": "^24.0.0",
81 | "typescript": "^5.5.3"
82 | },
83 | "lint-staged": {
84 | ".github/workflows/*.{yml,yaml}": [
85 | "pin-github-action --allow-empty"
86 | ],
87 | "*.{js,jsx,ts,tsx,css,md,yml,yaml}": "prettier --write"
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/presets/typescript-node.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | extends: [
6 | "peerigon",
7 | "peerigon/typescript",
8 | "peerigon/styles/prefer-arrow",
9 | "peerigon/node",
10 | // prettier must be at the end
11 | "prettier",
12 | ],
13 | root: true,
14 | };
15 |
--------------------------------------------------------------------------------
/presets/typescript-react.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | extends: [
6 | "peerigon",
7 | "peerigon/typescript",
8 | "peerigon/styles/prefer-arrow",
9 | "peerigon/react",
10 | // prettier must be at the end
11 | "prettier",
12 | ],
13 | root: true,
14 | };
15 |
--------------------------------------------------------------------------------
/presets/typescript.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | extends: [
6 | "peerigon",
7 | "peerigon/typescript",
8 | "peerigon/styles/prefer-arrow",
9 | // prettier must be at the end
10 | "prettier",
11 | ],
12 | root: true,
13 | };
14 |
--------------------------------------------------------------------------------
/prettier.config.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | module.exports = {
4 | plugins: ["@ianvs/prettier-plugin-sort-imports"],
5 | // Overwriting the default configuration because of "importAttributes".
6 | // TODO: Remove this once "importAttributes" is added to the default configuration.
7 | importOrderParserPlugins: [
8 | "typescript",
9 | "jsx",
10 | "decorators",
11 | "importAttributes",
12 | ],
13 | // Overwrites the default TS version of "1.0.0".
14 | // It's a little bit annoying to specify the TS version here as we don't know
15 | // the project's TS version (and we also don't want to update this file every time).
16 | // Specifying the most major version should be enough for now.
17 | importOrderTypeScriptVersion: "5.0.0",
18 | };
19 |
--------------------------------------------------------------------------------
/react.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["react", "jsx-a11y", "react-hooks"],
6 | extends: [
7 | "plugin:import/react",
8 | "plugin:react/recommended",
9 | "plugin:react/jsx-runtime",
10 | "plugin:jsx-a11y/recommended",
11 | ],
12 | settings: {
13 | react: {
14 | version: "detect",
15 | },
16 | },
17 | overrides: [
18 | {
19 | files: "*.ts{,x}",
20 | rules: {
21 | "react/prop-types": "off", // We expect React components to be checked by TypeScript
22 | },
23 | },
24 | ],
25 | rules: {
26 | /* eslint-enable sort-keys */
27 | // Allow certain react methods to have no this
28 | // See https://github.com/peerigon/eslint-config-peerigon/issues/12
29 | "class-methods-use-this": [
30 | "off",
31 | {
32 | exceptMethods: [
33 | "render",
34 | "getInitialState",
35 | "getDefaultProps",
36 | "getChildContext",
37 | "shouldComponentUpdate",
38 | ],
39 | },
40 | ],
41 | "react-hooks/exhaustive-deps": "warn", // https://www.npmjs.com/package/eslint-plugin-react-hooks
42 | "react-hooks/rules-of-hooks": "warn", // https://www.npmjs.com/package/eslint-plugin-react-hooks
43 | "react/boolean-prop-naming": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
44 | "react/button-has-type": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md
45 | "react/default-props-match-prop-types": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/default-props-match-prop-types.md
46 | "react/destructuring-assignment": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
47 | "react/display-name": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
48 | "react/forbid-component-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md
49 | "react/forbid-dom-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-dom-props.md
50 | "react/forbid-elements": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-elements.md
51 | "react/forbid-foreign-prop-types": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
52 | "react/forbid-prop-types": [
53 | "warn",
54 | {
55 | checkChildContextTypes: true,
56 | checkContextTypes: true,
57 | },
58 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
59 | "react/jsx-boolean-value": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
60 | "react/jsx-child-element-spacing": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-child-element-spacing.md
61 | "react/jsx-closing-bracket-location": ["warn", "line-aligned"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
62 | "react/jsx-closing-tag-location": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-tag-location.md
63 | "react/jsx-curly-brace-presence": ["warn", "never"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md
64 | "react/jsx-curly-spacing": ["warn", "never"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
65 | "react/jsx-equals-spacing": ["warn", "never"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-equals-spacing.md
66 | "react/jsx-filename-extension": [
67 | "warn",
68 | {
69 | // There's a big discussion whether the jsx/tsx is necessary:
70 | // - https://github.com/facebook/create-react-app/issues/87
71 | // - https://github.com/airbnb/javascript/pull/985
72 | // Since VSCode handles tsx files out-of-the-box, let's stick with the x-extensions
73 | extensions: [".jsx", ".tsx"],
74 | },
75 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
76 | "react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md
77 | "react/jsx-handler-names": [
78 | "warn",
79 | {
80 | eventHandlerPrefix: "handle",
81 | eventHandlerPropPrefix: "on",
82 | },
83 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
84 | "react/jsx-indent": ["warn", 4], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent.md
85 | "react/jsx-indent-props": ["warn", 4], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
86 | "react/jsx-key": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
87 | "react/jsx-max-props-per-line": [
88 | "warn",
89 | {
90 | maximum: 4,
91 | },
92 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md
93 | // See https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md#protips
94 | "react/jsx-no-bind": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
95 | "react/jsx-no-comment-textnodes": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-comment-textnodes.md
96 | "react/jsx-no-duplicate-props": [
97 | "warn",
98 | {
99 | ignoreCase: true,
100 | },
101 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
102 | "react/jsx-no-target-blank": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
103 | "react/jsx-no-undef": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
104 | "react/jsx-pascal-case": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
105 | "react/jsx-sort-default-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-default-props.md
106 | "react/jsx-sort-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
107 | "react/jsx-tag-spacing": [
108 | "warn",
109 | {
110 | afterOpening: "never",
111 | beforeSelfClosing: "always",
112 | closingSlash: "never",
113 | },
114 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
115 | "react/jsx-uses-react": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
116 | "react/jsx-uses-vars": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
117 | "react/no-access-state-in-setstate": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
118 | "react/no-array-index-key": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md
119 | "react/no-children-prop": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-children-prop.md
120 | "react/no-danger": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md
121 | "react/no-danger-with-children": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md
122 | "react/no-deprecated": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
123 | "react/no-did-mount-set-state": ["warn", "disallow-in-func"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
124 | "react/no-did-update-set-state": ["warn", "disallow-in-func"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md
125 | "react/no-direct-mutation-state": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
126 | "react/no-find-dom-node": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
127 | "react/no-is-mounted": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
128 | "react/no-multi-comp": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
129 | "react/no-redundant-should-component-update": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-redundant-should-component-update.md
130 | "react/no-render-return-value": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
131 | "react/no-set-state": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
132 | "react/no-string-refs": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
133 | "react/no-this-in-sfc": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md
134 | "react/no-typos": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-typos.md
135 | "react/no-unescaped-entities": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
136 | "react/no-unknown-property": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
137 | "react/no-unused-prop-types": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
138 | "react/no-unused-state": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md
139 | "react/no-will-update-set-state": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-will-update-set-state.md
140 | "react/prefer-es6-class": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
141 | "react/prefer-stateless-function": [
142 | "warn",
143 | {
144 | ignorePureComponents: true,
145 | },
146 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
147 | "react/prop-types": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
148 | "react/react-in-jsx-scope": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
149 | "react/require-default-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
150 | "react/require-optimization": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-optimization.md
151 | "react/require-render-return": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-render-return.md
152 | "react/self-closing-comp": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
153 | "react/sort-comp": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
154 | "react/sort-prop-types": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md
155 | "react/style-prop-object": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/style-prop-object.md
156 | "react/void-dom-elements-no-children": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
157 | },
158 | };
159 |
--------------------------------------------------------------------------------
/styles/no-default-export.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | const globPatterns = require("../glob-patterns.js");
5 |
6 | module.exports = {
7 | rules: {
8 | "import/no-default-export": "warn",
9 | },
10 | overrides: [
11 | {
12 | files: globPatterns.react,
13 | rules: {
14 | "import/no-default-export": "off",
15 | },
16 | },
17 | ],
18 | };
19 |
--------------------------------------------------------------------------------
/styles/no-null.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["no-null"],
6 | rules: {
7 | "no-null/no-null": "warn",
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/styles/prefer-array-shorthand.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["@typescript-eslint"],
6 | rules: {
7 | "@typescript-eslint/array-type": [
8 | "warn",
9 | {
10 | default: "array",
11 | },
12 | ],
13 | },
14 | };
15 |
--------------------------------------------------------------------------------
/styles/prefer-arrow.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | plugins: ["prefer-arrow"],
6 | rules: {
7 | "func-style": ["warn", "expression"], // http://eslint.org/docs/rules/func-style
8 | // https://github.com/TristonJ/eslint-plugin-prefer-arrow
9 | "prefer-arrow/prefer-arrow-functions": [
10 | "warn",
11 | {
12 | disallowPrototype: false,
13 | singleReturnOnly: false,
14 | // We used to enforce arrow functions also for class methods (as class properties)
15 | // but arrow functions in sub-classes can't call their overridden counterpart
16 | // in their super-class, see https://stackoverflow.com/a/52823577
17 | classPropertiesAllowed: false,
18 | },
19 | ],
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/styles/prefer-interface.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | rules: {
6 | "@typescript-eslint/consistent-type-definitions": ["warn", "interface"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/class-name-casing.md
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/styles/react-jsx-no-bind.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | module.exports = {
5 | rules: {
6 | "react/jsx-no-bind": [
7 | // We're using only "warn" here because it's not a hard error,
8 | // but it can be a problem if React.memo is used a lot.
9 | // Use styles/react-jsx-allow-bind if you're not using React.memo.
10 | "warn",
11 | {
12 | allowArrowFunctions: false,
13 | allowBind: false,
14 | allowFunctions: false,
15 | ignoreDOMComponents: true,
16 | ignoreRefs: true,
17 | },
18 | ], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md
19 | },
20 | };
21 |
--------------------------------------------------------------------------------
/styles/react-jsx-no-literals.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | const globPatterns = require("../glob-patterns.js");
5 |
6 | module.exports = {
7 | rules: {
8 | /* eslint-enable sort-keys */
9 | // If we don't adjust this rule, it would autofix the escape hatch
10 | // {"some string"} allowed by "jsx-no-literals"
11 | "react/jsx-curly-brace-presence": [
12 | "warn",
13 | {
14 | children: "always",
15 | props: "never",
16 | },
17 | ],
18 | "react/jsx-no-literals": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
19 | /* eslint-disable sort-keys */
20 | },
21 | overrides: [
22 | {
23 | files: globPatterns.tests,
24 | rules: {
25 | /* eslint-enable sort-keys */
26 | // It's quite common in tests to use example strings
27 | "react/jsx-curly-brace-presence": ["warn", "never"],
28 | "react/jsx-no-literals": "off",
29 | /* eslint-disable sort-keys */
30 | },
31 | },
32 | ],
33 | };
34 |
--------------------------------------------------------------------------------
/tests.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | const options = require("./options.js");
5 |
6 | module.exports = {
7 | env: {
8 | mocha: true,
9 | jest: true,
10 | },
11 | globals: {
12 | cy: true,
13 | Cypress: true,
14 | assert: true,
15 | },
16 | rules: {
17 | /* eslint-enable sort-keys */
18 | // chai uses these as assertions
19 | "@babel/no-unused-expressions": "off",
20 | // In order to make mocks more condensed, single line blocks are allowed in tests
21 | // Storybook stories export a default config object which gets used by their pipeline
22 | "import/no-anonymous-default-export": "off",
23 | // In test scenarios this kind of module pattern is more usual
24 | "import/no-unassigned-import": "off",
25 | // Long tests are not necessarily a problem, but there is a certain limit
26 | "max-lines": "off",
27 | // mocha blocks are nested all the way down
28 | "max-nested-callbacks": "off",
29 | // Allows empty catch blocks in try clauses
30 | "no-empty": "off",
31 | // If you want to test for thrown errors in a constructor function, it's common to ignore the result
32 | // @see https://github.com/peerigon/clockodo/pull/1#discussion_r180795825
33 | "no-new": "off",
34 | // It's uncommon to use async/await in Cypress tests
35 | // https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Commands-Are-Asynchronous
36 | "promise/no-nesting": "off",
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/tests/javascript/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../base.js"],
3 | "env": {
4 | "browser": true
5 | },
6 | "root": true
7 | }
8 |
--------------------------------------------------------------------------------
/tests/javascript/babel.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env"],
3 | "plugins": [
4 | "@babel/plugin-proposal-class-properties",
5 | "@babel/plugin-syntax-import-attributes"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/tests/javascript/main.js:
--------------------------------------------------------------------------------
1 | import { getMessage } from "./message.js";
2 | // Check if import attributes are detected and formatted correctly
3 | import test from "./test.json" with { type: "json" };
4 |
5 | class SomeClass {
6 | #someProp = true;
7 |
8 | logSomeProp() {
9 | console.log(this.#someProp);
10 | }
11 | }
12 |
13 | console.log(getMessage(), SomeClass, test);
14 |
--------------------------------------------------------------------------------
/tests/javascript/message.js:
--------------------------------------------------------------------------------
1 | export function getMessage() {
2 | return "Hello World";
3 | }
4 |
--------------------------------------------------------------------------------
/tests/javascript/test.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/tests/javascript/webpack.config.js:
--------------------------------------------------------------------------------
1 | // Should not generate an error in .config-files
2 | export default {};
3 |
--------------------------------------------------------------------------------
/tests/node/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../node.js"],
3 | "root": true
4 | }
5 |
--------------------------------------------------------------------------------
/tests/node/main.js:
--------------------------------------------------------------------------------
1 | import { getMessage } from "./message.js";
2 |
3 | console.log(getMessage(), SomeClass);
4 |
--------------------------------------------------------------------------------
/tests/node/message.js:
--------------------------------------------------------------------------------
1 | export function getMessage() {
2 | return "Hello World";
3 | }
4 |
--------------------------------------------------------------------------------
/tests/node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "node-test",
3 | "version": "1.0.0",
4 | "description": "",
5 | "type": "module",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": []
10 | }
11 |
--------------------------------------------------------------------------------
/tests/react/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | // Should be the same as in "../../presets/typescript-react.js"
4 | "../../base.js",
5 | "../../typescript.js",
6 | "../../styles/prefer-arrow.js",
7 | "../../react.js",
8 | // prettier must be at the end
9 | "prettier"
10 | ],
11 | "root": true
12 | }
13 |
--------------------------------------------------------------------------------
/tests/react/main.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 |
3 | export const Test = () => ;
4 |
--------------------------------------------------------------------------------
/tests/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "esnext",
5 | "lib": ["dom", "esnext"],
6 | "strict": true,
7 | "moduleResolution": "node",
8 | "esModuleInterop": true,
9 | "jsx": "react"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/typescript/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | node: true,
4 | },
5 | extends: [
6 | // Should be the same as in "../../presets/typescript.js"
7 | "../../base.js",
8 | "../../typescript.js",
9 | "../../styles/prefer-arrow.js",
10 | // prettier must be at the end
11 | "prettier",
12 | ],
13 | root: true,
14 | };
15 |
--------------------------------------------------------------------------------
/tests/typescript/main.ts:
--------------------------------------------------------------------------------
1 | import { getMessage } from "./message.js";
2 | // Check if import attributes are detected and formatted correctly
3 | import test from "./test.json" with { type: "json" };
4 |
5 | // Should be an error
6 | // eslint-disable-next-line @typescript-eslint/naming-convention
7 | const snake_case = 123;
8 |
9 | class SomeClass {
10 | #someProp = true;
11 | private someEventHandler = () => {
12 | // Arrow functions as class properties should be ok...
13 | };
14 |
15 | someMethod() {
16 | // ...as well as regular functions.
17 | // See styles/prefer-arrow.js for an explanation.
18 |
19 | console.log(this.#someProp);
20 | }
21 |
22 | // Should be an error
23 | // eslint-disable-next-line @typescript-eslint/naming-convention
24 | snake_case() {}
25 | }
26 |
27 | console.log(getMessage(), SomeClass, snake_case, test);
28 |
--------------------------------------------------------------------------------
/tests/typescript/message.ts:
--------------------------------------------------------------------------------
1 | export const getMessage = (): string => {
2 | return "Hello World";
3 | };
4 |
--------------------------------------------------------------------------------
/tests/typescript/test.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/tests/typescript/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "esnext",
5 | "lib": ["dom", "esnext"],
6 | "strict": true,
7 | "moduleResolution": "node",
8 | "esModuleInterop": true,
9 | "resolveJsonModule": true
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tests/typescript/types.d.ts:
--------------------------------------------------------------------------------
1 | interface SomeInterface {
2 | // Should not complain about the method signature style here because
3 | // it's sometimes necessary to define these overloads for 3rd party packages
4 | someMethod(param: boolean): void;
5 | someMethod(param1: number, param2: number): void;
6 | }
7 |
8 | declare module "some-module" {
9 | // Should not complain about export default
10 | export default SomeInterface;
11 | }
12 |
--------------------------------------------------------------------------------
/typescript.js:
--------------------------------------------------------------------------------
1 | /* eslint sort-keys: ["error", "asc"] */
2 | /* eslint-disable sort-keys */
3 |
4 | const options = require("./options.js");
5 | const globPatterns = require("./glob-patterns.js");
6 |
7 | module.exports = {
8 | plugins: ["@typescript-eslint"],
9 | overrides: [
10 | {
11 | files: globPatterns.typescript,
12 | parser: "@typescript-eslint/parser",
13 | parserOptions: {
14 | ecmaVersion: "latest",
15 | project: true,
16 | extraFileExtensions: [".vue"],
17 | },
18 | extends: [
19 | "plugin:import/typescript",
20 | "plugin:@typescript-eslint/recommended",
21 | "plugin:@typescript-eslint/eslint-recommended",
22 | "plugin:@typescript-eslint/recommended-requiring-type-checking",
23 | ],
24 | rules: {
25 | /* eslint-enable sort-keys */
26 | "@babel/new-cap": "off", // There are some false positives with this rule (e.g. when a library is using uppercase letters) and TypeScript catches these errors anyway
27 | "@babel/no-invalid-this": "off", // covered by @typescript-eslint/no-invalid-this
28 | "@babel/no-unused-expressions": "off", // covered by @typescript-eslint/no-unused-expressions
29 | // "no-undef": "off", // produces false positive with some TypeScript syntax. This is caught by TypeScript anyway.
30 | "@typescript-eslint/adjacent-overload-signatures": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md
31 | "@typescript-eslint/array-type": [
32 | "warn",
33 | { default: "generic" },
34 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/array-type.md
35 | "@typescript-eslint/await-thenable": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/await-thenable.md
36 | // Disable the warning for legimitate use cases
37 | "@typescript-eslint/ban-ts-comment": [
38 | "warn",
39 | {
40 | "ts-expect-error": "allow-with-description",
41 | },
42 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-ts-comment.md
43 | "@typescript-eslint/ban-tslint-comment": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-tslint-comment.md
44 | "@typescript-eslint/ban-types": [
45 | "warn",
46 | options["@typescript-eslint/ban-types"],
47 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md
48 | // Handled by @typescript-eslint/naming-convention
49 | "@typescript-eslint/camelcase": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md
50 | "@typescript-eslint/class-literal-property-style": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/class-literal-property-style.md
51 | "@typescript-eslint/consistent-indexed-object-style": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md
52 | "@typescript-eslint/consistent-type-assertions": [
53 | "warn",
54 | {
55 | assertionStyle: "as",
56 | // Using {} as Something can hide errors (see rule docs).
57 | // It's better to declare a typed variable first.
58 | objectLiteralTypeAssertions: "allow-as-parameter",
59 | },
60 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-assertions.md
61 | "@typescript-eslint/consistent-type-definitions": [
62 | "warn",
63 | "type",
64 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
65 | "@typescript-eslint/consistent-type-imports": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-imports.md
66 | "@typescript-eslint/default-param-last": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/default-param-last.md
67 | "@typescript-eslint/dot-notation": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
68 | "@typescript-eslint/explicit-function-return-type": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
69 | "@typescript-eslint/explicit-member-accessibility": [
70 | "warn",
71 | {
72 | accessibility: "no-public",
73 | overrides: {
74 | parameterProperties: "explicit",
75 | },
76 | },
77 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
78 | "@typescript-eslint/explicit-module-boundary-types": [
79 | "off",
80 | {
81 | allowDirectConstAssertionInArrowFunctions: true,
82 | allowHigherOrderFunctions: true,
83 | allowTypedFunctionExpressions: true,
84 | allowedNames: [],
85 | },
86 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
87 | "@typescript-eslint/func-call-spacing": ["warn"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
88 | "@typescript-eslint/generic-type-naming": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/generic-type-naming.md
89 | "@typescript-eslint/init-declarations": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/init-declarations.md
90 | "@typescript-eslint/member-delimiter-style": [
91 | "warn",
92 | {
93 | // We're using "semi" because classes do only allow semi
94 | // and we want to stay consistent with them.
95 | multiline: {
96 | delimiter: "semi",
97 | requireLast: true,
98 | },
99 | singleline: {
100 | delimiter: "semi",
101 | requireLast: false,
102 | },
103 | },
104 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-delimiter-style.md
105 | "@typescript-eslint/member-naming": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-naming.md
106 | "@typescript-eslint/member-ordering": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/member-ordering.md
107 | "@typescript-eslint/method-signature-style": [
108 | "warn",
109 | "property",
110 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/method-signature-style.md
111 | "@typescript-eslint/naming-convention": [
112 | "warn",
113 | ...options["@typescript-eslint/naming-convention"]
114 | .defaultRules,
115 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
116 | "@typescript-eslint/no-array-constructor": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
117 | "@typescript-eslint/no-base-to-string": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-base-to-string.md
118 | "@typescript-eslint/no-confusing-non-null-assertion": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md
119 | // There are too many false positives with this rule
120 | // Additionally, there are situations where you just want to pass on the returned value even
121 | // when it's currently annotated as 'void'
122 | "@typescript-eslint/no-confusing-void-expression": [
123 | "off",
124 | {
125 | ignoreArrowShorthand: true,
126 | ignoreVoidOperator: true,
127 | },
128 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/no-confusing-void-expression.md
129 | "@typescript-eslint/no-dupe-class-members": ["warn"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
130 | "@typescript-eslint/no-dynamic-delete": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dynamic-delete.md
131 | "@typescript-eslint/no-empty-function": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
132 | "@typescript-eslint/no-empty-interface": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-interface.md
133 | // There are situations where explicit 'any' is the most pragmatic way.
134 | // The appropiate use of 'any' requires human peer reviews :)
135 | "@typescript-eslint/no-explicit-any": [
136 | "off",
137 | {
138 | fixToUnknown: false,
139 | ignoreRestArgs: true,
140 | },
141 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md
142 | "@typescript-eslint/no-extra-non-null-assertion": ["warn"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md
143 | "@typescript-eslint/no-extra-parens": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
144 | "@typescript-eslint/no-extraneous-class": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extraneous-class.md
145 | // This rule might be a good idea, but often it's ok to let the global error handler handle it
146 | "@typescript-eslint/no-floating-promises": [
147 | "off",
148 | {
149 | ignoreVoid: true,
150 | },
151 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md
152 | "@typescript-eslint/no-for-in-array": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-for-in-array.md
153 | "@typescript-eslint/no-implicit-any-catch": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
154 | "@typescript-eslint/no-implied-eval": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
155 | "@typescript-eslint/no-inferrable-types": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-inferrable-types.md
156 | "@typescript-eslint/no-invalid-this": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-this.md
157 | "@typescript-eslint/no-invalid-void-type": [
158 | "warn",
159 | {
160 | allowAsThisParameter: true,
161 | allowInGenericTypeArguments: true,
162 | },
163 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-void-type.md
164 | // With let and const this is not an issue anymore
165 | "@typescript-eslint/no-loop-func": ["off"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
166 | "@typescript-eslint/no-loss-of-precision": ["warn"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
167 | "@typescript-eslint/no-magic-numbers": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
168 | "@typescript-eslint/no-misused-new": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-new.md
169 | "@typescript-eslint/no-misused-promises": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-misused-promises.md
170 | "@typescript-eslint/no-namespace": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-namespace.md
171 | "@typescript-eslint/no-non-null-asserted-optional-chain":
172 | "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md
173 | // Unfortunately non-null assertions are sometimes necessary
174 | // e.g. when working with Maps
175 | "@typescript-eslint/no-non-null-assertion": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-non-null-assertion.md
176 | "@typescript-eslint/no-parameter-properties": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-parameter-properties.md
177 | "@typescript-eslint/no-redeclare": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
178 | "@typescript-eslint/no-require-imports": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-require-imports.md
179 | "@typescript-eslint/no-shadow": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
180 | "@typescript-eslint/no-this-alias": [
181 | "warn",
182 | {
183 | allowDestructuring: true,
184 | allowedNames: [],
185 | },
186 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-this-alias.md
187 | // When this rule is enabled, re-throwing an unknown error becomes a problem because
188 | // we can't guarantee that it's going to be an error object.
189 | // This rule would always report a warning in this case which is annoying.
190 | "@typescript-eslint/no-throw-literal": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
191 | "@typescript-eslint/no-type-alias": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-type-alias.md
192 | "@typescript-eslint/no-unnecessary-boolean-literal-compare":
193 | "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
194 | "@typescript-eslint/no-unnecessary-condition": [
195 | "warn",
196 | {
197 | allowConstantLoopConditions: true,
198 | },
199 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md
200 | "@typescript-eslint/no-unnecessary-qualifier": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md
201 | "@typescript-eslint/no-unnecessary-type-arguments": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md
202 | "@typescript-eslint/no-unnecessary-type-assertion": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
203 | "@typescript-eslint/no-unnecessary-type-constraint": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
204 | // In practice, these unsafe rules are too strict. It's ok to use 'any' within a function.
205 | // We decided to keep @typescript-eslint/no-unsafe-return in order to avoid that 'any'
206 | // leaks into the rest of the application
207 | "@typescript-eslint/no-unsafe-argument": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-argument.md
208 | "@typescript-eslint/no-unsafe-assignment": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md
209 | "@typescript-eslint/no-unsafe-call": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-call.md
210 | "@typescript-eslint/no-unsafe-member-access": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md
211 | "@typescript-eslint/no-unsafe-return": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unsafe-return.md
212 | "@typescript-eslint/no-unused-expressions": [
213 | "warn",
214 | options["no-unused-expressions"],
215 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
216 | "@typescript-eslint/no-unused-vars": [
217 | "warn",
218 | options["no-unused-vars"],
219 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
220 | "@typescript-eslint/no-unused-vars-experimental": "off", // https://github.com/typescript-eslint/typescript-eslint/tree/v2.19.0/packages/eslint-plugin
221 | // The following rules would require to sort each function (declaration and expression)
222 | // in a module in a specific way which seems to be impractical.
223 | "@typescript-eslint/no-use-before-define": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
224 | "@typescript-eslint/no-useless-constructor": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
225 | "@typescript-eslint/no-var-requires": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-var-requires.md
226 | // Using the ! operator to remove the nullable type is often better because it does not
227 | // require refactoring if you decide to change the non-nullable type later.
228 | // For instance:
229 | // declare a: undefined | string;
230 | // const b = a as string; // what if we change "string" later to "number"?
231 | "@typescript-eslint/non-nullable-type-assertion-style": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md
232 | "@typescript-eslint/prefer-as-const": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-as-const.md
233 | "@typescript-eslint/prefer-enum-initializers": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md
234 | "@typescript-eslint/prefer-for-of": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-for-of.md
235 | "@typescript-eslint/prefer-function-type": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-function-type.md
236 | "@typescript-eslint/prefer-includes": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-includes.md
237 | "@typescript-eslint/prefer-interface": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-interface.md
238 | // Dynamic enum members are quite rare and the problem illustrated in the readme sounds like a footgun.
239 | // If dynamic enums are necessary in certain cases, this rule can be disabled.
240 | "@typescript-eslint/prefer-literal-enum-member": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md
241 | "@typescript-eslint/prefer-namespace-keyword": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md
242 | "@typescript-eslint/prefer-nullish-coalescing": [
243 | "warn",
244 | {
245 | ignoreConditionalTests: true,
246 | ignoreMixedLogicalExpressions: true,
247 | },
248 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
249 | "@typescript-eslint/prefer-optional-chain": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
250 | // We can't activate prefer-readonly currently as we don't want to flag class properties
251 | // that are functions as readonly (although it would be correct).
252 | // Enabling prefer-readonly would require developers to write
253 | // private readonly someMethod = () => {};
254 | // which is verbose and kind of annoying.
255 | "@typescript-eslint/prefer-readonly": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly.md
256 | "@typescript-eslint/prefer-readonly-parameter-types": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
257 | "@typescript-eslint/prefer-reduce-type-parameter": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
258 | // Sometimes it makes more sense to use .match() or maybe the global flag is added later.
259 | // In this case we want to prevent the developer from needing to refactor the code.
260 | "@typescript-eslint/prefer-regexp-exec": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
261 | "@typescript-eslint/prefer-string-starts-ends-with": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md
262 | "@typescript-eslint/prefer-ts-expect-error": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md
263 | "@typescript-eslint/promise-function-async": [
264 | "warn",
265 | {
266 | allowAny: true,
267 | allowedPromiseNames: [],
268 | checkArrowFunctions: true,
269 | checkFunctionDeclarations: true,
270 | checkFunctionExpressions: true,
271 | checkMethodDeclarations: true,
272 | },
273 | ], // https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
274 | "@typescript-eslint/require-array-sort-compare": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-array-sort-compare.md
275 | "@typescript-eslint/require-await": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
276 | "@typescript-eslint/restrict-plus-operands": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
277 | "@typescript-eslint/restrict-template-expressions": [
278 | "off",
279 | {
280 | allowBoolean: false,
281 | allowNullable: false,
282 | allowNumber: true,
283 | },
284 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
285 | "@typescript-eslint/return-await": ["warn", "in-try-catch"], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
286 | "@typescript-eslint/sort-type-union-intersection-members":
287 | "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md
288 | "@typescript-eslint/strict-boolean-expressions": [
289 | "off",
290 | {
291 | allowNullable: true,
292 | allowSafe: true,
293 | ignoreRhs: true,
294 | },
295 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
296 | "@typescript-eslint/switch-exhaustiveness-check": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
297 | "@typescript-eslint/triple-slash-reference": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/triple-slash-reference.md
298 | "@typescript-eslint/type-annotation-spacing": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
299 | "@typescript-eslint/typedef": "off", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/typedef.md
300 | "@typescript-eslint/unbound-method": [
301 | "warn",
302 | {
303 | ignoreStatic: true,
304 | },
305 | ], // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unbound-method.md
306 | "@typescript-eslint/unified-signatures": "warn", // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/unified-signatures.md
307 | camelcase: "off", // covered by @typescript-eslint/naming-convention
308 | // There's currently a problem with this rule, see https://github.com/benmosher/eslint-plugin-import/issues/1341
309 | "import/export": "off", // TypeScript should catch it anyway
310 | "import/extensions": [
311 | "warn",
312 | "ignorePackages",
313 | {
314 | ts: "never",
315 | tsx: "never",
316 | },
317 | ], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
318 | // TypeScript project have usually more imports due to types
319 | "import/max-dependencies": ["warn", { max: 45 }],
320 | "import/named": "off", // TypeScript should catch it anyway
321 | "import/namespace": "off", // TypeScript should catch it anyway
322 | "import/no-unresolved": "off", // TypeScript should catch it anyway
323 | indent: "off",
324 | // TypeScript files tend to get longer due to types
325 | "max-lines": [
326 | "warn",
327 | {
328 | ...options["max-lines"],
329 | max: 1400,
330 | },
331 | ],
332 | "no-dupe-class-members": "off", // covered by @typescript-eslint/no-dupe-class-members
333 | "no-empty-function": "off", // covered by @typescript-eslint/no-empty-function
334 | "no-loop-func": "off", // covered by @typescript-eslint/no-loop-func
335 | "no-loss-of-precision": "off", // covered by @typescript-eslint/no-loss-of-precision
336 | "no-redeclare": "off", // covered by @typescript-eslint/no-redeclare
337 | "no-useless-constructor": "off", // covered by @typescript-eslint/no-useless-constructor
338 | semi: "off", // covered by @typescript-eslint/semi
339 | },
340 | },
341 | {
342 | files: ["*.d.ts"],
343 | rules: {
344 | // In d.ts files it might be necessary to merge an existing interface
345 | "@typescript-eslint/consistent-type-definitions": "off",
346 | // In d.ts files it's sometimes necessary to overload existing methods
347 | "@typescript-eslint/method-signature-style": "off",
348 | "@typescript-eslint/naming-convention": "off",
349 | // Unused vars can be common in d.ts files when declaration merging is used
350 | "@typescript-eslint/no-unused-vars": "off",
351 | // Since d.ts files are used to type external modules, we can't control the coding style
352 | "import/no-default-export": "off",
353 | // When someone wants to extend the typings of a third-party module, it might
354 | // be necessary to import the module so that TypeScript finds the typings that should be extended.
355 | // This is a better alternative to the triple-slash directive
356 | "import/no-unassigned-import": "off",
357 | },
358 | },
359 | {
360 | files: globPatterns.tests,
361 | rules: {
362 | // Type assertions are quite common in tests
363 | "@typescript-eslint/consistent-type-assertions": "off",
364 | // Mocking often requires to mock objects with a different naming convention
365 | "@typescript-eslint/naming-convention": "off",
366 | // We allow any to be used in tests, so returning it is ok
367 | "@typescript-eslint/no-unsafe-return": "off",
368 | // chai uses these as assertions
369 | "@typescript-eslint/no-unused-expressions": "off",
370 | // It's uncommon to use async/await in Cypress tests
371 | // https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Commands-Are-Asynchronous
372 | "@typescript-eslint/promise-function-async": "off",
373 | // Passing functions around like this can be common with mocking
374 | "@typescript-eslint/unbound-method": "off",
375 | },
376 | },
377 | ],
378 | };
379 |
--------------------------------------------------------------------------------