@commercetools-backend/eslint-config-node 0.0.0-FEC-157-preview-releases-20241126230331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,381 @@
1
+ # @commercetools-backend/eslint-config-node
2
+
3
+ ## 0.0.0-FEC-157-preview-releases-20241126230331
4
+
5
+ ## 22.35.1
6
+
7
+ ## 22.35.0
8
+
9
+ ## 22.34.0
10
+
11
+ ## 22.33.0
12
+
13
+ ## 22.32.2
14
+
15
+ ## 22.32.1
16
+
17
+ ## 22.32.0
18
+
19
+ ## 22.31.0
20
+
21
+ ## 22.30.3
22
+
23
+ ## 22.30.2
24
+
25
+ ## 22.30.1
26
+
27
+ ## 22.30.0
28
+
29
+ ## 22.29.0
30
+
31
+ ## 22.28.0
32
+
33
+ ## 22.27.0
34
+
35
+ ## 22.26.0
36
+
37
+ ## 22.25.1
38
+
39
+ ## 22.25.0
40
+
41
+ ### Patch Changes
42
+
43
+ - [#3499](https://github.com/commercetools/merchant-center-application-kit/pull/3499) [`0d48d6c`](https://github.com/commercetools/merchant-center-application-kit/commit/0d48d6c0770f2ab6c0f80597fba54dc0f13a3172) Thanks [@emmenko](https://github.com/emmenko)! - Leftovers for migrating from `eslint-plugin-node` to `eslint-plugin-n`
44
+
45
+ ## 22.24.0
46
+
47
+ ### Patch Changes
48
+
49
+ - [#3467](https://github.com/commercetools/merchant-center-application-kit/pull/3467) [`b08e604`](https://github.com/commercetools/merchant-center-application-kit/commit/b08e60425c201ff23c60963c354f3c187b3d65f6) Thanks [@renovate](https://github.com/apps/renovate)! - Replace `eslint-config-node` with community package `eslint-plugin-n`
50
+
51
+ - [#3491](https://github.com/commercetools/merchant-center-application-kit/pull/3491) [`c2bba1d`](https://github.com/commercetools/merchant-center-application-kit/commit/c2bba1d065b6fd7882e6feb9162d91538962d85d) Thanks [@emmenko](https://github.com/emmenko)! - Adjust links to new docs
52
+
53
+ ## 22.23.3
54
+
55
+ ## 22.23.2
56
+
57
+ ## 22.23.1
58
+
59
+ ## 22.23.0
60
+
61
+ ### Patch Changes
62
+
63
+ - [#3435](https://github.com/commercetools/merchant-center-application-kit/pull/3435) [`e7299e2`](https://github.com/commercetools/merchant-center-application-kit/commit/e7299e265ceb8579ed4901adddcb2fde791c62db) Thanks [@renovate](https://github.com/apps/renovate)! - Update all dependencies
64
+
65
+ ## 22.22.0
66
+
67
+ ## 22.21.0
68
+
69
+ ## 22.20.0
70
+
71
+ ## 22.19.0
72
+
73
+ ## 22.18.0
74
+
75
+ ## 22.17.2
76
+
77
+ ## 22.17.1
78
+
79
+ ## 22.17.0
80
+
81
+ ### Minor Changes
82
+
83
+ - [#3379](https://github.com/commercetools/merchant-center-application-kit/pull/3379) [`d2e3a2236`](https://github.com/commercetools/merchant-center-application-kit/commit/d2e3a22361140ee77b4aa7f624d7b2b71de35bab) Thanks [@tylermorrisford](https://github.com/tylermorrisford)! - Update all logos in `assets/logos/`, all logos in `assets/images/` and embedded logo in `application.html`.
84
+
85
+ ## 22.16.0
86
+
87
+ ## 22.15.1
88
+
89
+ ### Patch Changes
90
+
91
+ - [#3369](https://github.com/commercetools/merchant-center-application-kit/pull/3369) [`a4f1d8814`](https://github.com/commercetools/merchant-center-application-kit/commit/a4f1d88146a82173afeb34bda5f7c5936b63c872) Thanks [@tdeekens](https://github.com/tdeekens)! - Update eslint to 8.56.0.
92
+
93
+ ## 22.15.0
94
+
95
+ ## 22.14.3
96
+
97
+ ## 22.14.2
98
+
99
+ ## 22.14.1
100
+
101
+ ## 22.14.0
102
+
103
+ ## 22.13.2
104
+
105
+ ## 22.13.1
106
+
107
+ ## 22.13.0
108
+
109
+ ## 22.12.0
110
+
111
+ ## 22.11.0
112
+
113
+ ## 22.10.0
114
+
115
+ ## 22.9.1
116
+
117
+ ## 22.9.0
118
+
119
+ ## 22.8.4
120
+
121
+ ## 22.8.3
122
+
123
+ ## 22.8.2
124
+
125
+ ## 22.8.1
126
+
127
+ ## 22.8.0
128
+
129
+ ### Patch Changes
130
+
131
+ - [#3082](https://github.com/commercetools/merchant-center-application-kit/pull/3082) [`e29ab64b6`](https://github.com/commercetools/merchant-center-application-kit/commit/e29ab64b6032ff42bdb2254ef4e57d16291a45db) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies
132
+
133
+ ## 22.7.1
134
+
135
+ ## 22.7.0
136
+
137
+ ## 22.6.0
138
+
139
+ ## 22.5.0
140
+
141
+ ### Patch Changes
142
+
143
+ - [#3135](https://github.com/commercetools/merchant-center-application-kit/pull/3135) [`6c4094e0e`](https://github.com/commercetools/merchant-center-application-kit/commit/6c4094e0e99461b860e3a2eda7b47094858ea329) Thanks [@renovate](https://github.com/apps/renovate)! - Update `@tsconfig/node16` dependency.
144
+
145
+ ## 22.4.0
146
+
147
+ ## 22.3.4
148
+
149
+ ## 22.3.3
150
+
151
+ ## 22.3.2
152
+
153
+ ## 22.3.1
154
+
155
+ ## 22.3.0
156
+
157
+ ### Patch Changes
158
+
159
+ - [#3061](https://github.com/commercetools/merchant-center-application-kit/pull/3061) [`448774957`](https://github.com/commercetools/merchant-center-application-kit/commit/44877495721371ae251e11f6b7d926344cfeae0b) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies.
160
+
161
+ ## 22.2.1
162
+
163
+ ## 22.2.0
164
+
165
+ ## 22.1.0
166
+
167
+ ## 22.0.1
168
+
169
+ ### Patch Changes
170
+
171
+ - [#3033](https://github.com/commercetools/merchant-center-application-kit/pull/3033) [`6629d8470`](https://github.com/commercetools/merchant-center-application-kit/commit/6629d84708e94cae14df8d1ce3df1eb1f99e2023) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies
172
+
173
+ ## 22.0.0
174
+
175
+ ### Major Changes
176
+
177
+ - [#3026](https://github.com/commercetools/merchant-center-application-kit/pull/3026) [`968c3c4d2`](https://github.com/commercetools/merchant-center-application-kit/commit/968c3c4d21e0caeb98334f5d905213dbdd9b208d) Thanks [@emmenko](https://github.com/emmenko)! - Upgrade following dependencies to major versions:
178
+
179
+ - `jest` to `v29.x`.
180
+ - `jsdom` to `v21.x`.
181
+ - `eslint-plugin-jest` to `v27.x`.
182
+
183
+ # Migration
184
+
185
+ The package `@commercetools-frontend/jest-preset-mc-app` contains most of the updates and migration changes.
186
+
187
+ We don't expect any specific migration effort besides updating all Jest dependencies to their latest version (including possible Jest plugins being used).
188
+
189
+ However, there are a couple of possible necessary updates to consider:
190
+
191
+ - [Jest snapshots format changed a bit](https://jestjs.io/docs/upgrading-to-jest29#snapshot-format). You might need to update your snapshots by passing the option `-u` to the Jest command.
192
+ - The ESLint plugin for Jest might yield some new errors due to its breaking changes. See [changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md#2700-2022-08-28).
193
+
194
+ For more detailed information about upgrading Jest, please refer to the official guides:
195
+
196
+ - [From v27 to v28](https://jestjs.io/docs/28.x/upgrading-to-jest28)
197
+ - [From v28 to v29](https://jestjs.io/docs/upgrading-to-jest29)
198
+
199
+ - [#3039](https://github.com/commercetools/merchant-center-application-kit/pull/3039) [`76ba54c16`](https://github.com/commercetools/merchant-center-application-kit/commit/76ba54c164dbac75ef3e3962292933b06f4843e7) Thanks [@emmenko](https://github.com/emmenko)! - Drop support for Node.js `v14`. Make sure you use Node.js `v16` or `>=v18`.
200
+
201
+ ## 21.25.2
202
+
203
+ ## 21.25.1
204
+
205
+ ## 21.25.0
206
+
207
+ ## 21.24.3
208
+
209
+ ## 21.24.2
210
+
211
+ ## 21.24.1
212
+
213
+ ## 21.24.0
214
+
215
+ ### Patch Changes
216
+
217
+ - [#2974](https://github.com/commercetools/merchant-center-application-kit/pull/2974) [`007cb8a04`](https://github.com/commercetools/merchant-center-application-kit/commit/007cb8a04d2d4813d6b1bd6001abd5e6b30c0de6) Thanks [@renovate](https://github.com/apps/renovate)! - Update all dependencies
218
+
219
+ - [#2999](https://github.com/commercetools/merchant-center-application-kit/pull/2999) [`975f3f505`](https://github.com/commercetools/merchant-center-application-kit/commit/975f3f505eb686d77b05e058dd9fea9ccd7f3e5e) Thanks [@renovate](https://github.com/apps/renovate)! - Update all dependencies
220
+
221
+ ## 21.23.10
222
+
223
+ ## 21.23.9
224
+
225
+ ### Patch Changes
226
+
227
+ - [#2979](https://github.com/commercetools/merchant-center-application-kit/pull/2979) [`6dcd48525`](https://github.com/commercetools/merchant-center-application-kit/commit/6dcd48525a9943ea7348345f32ae218a5154867b) Thanks [@emmenko](https://github.com/emmenko)! - Refine engine version requirements for Nodejs to be `14.x || >=16.0.0`
228
+
229
+ ## 21.23.8
230
+
231
+ ## 21.23.7
232
+
233
+ ### Patch Changes
234
+
235
+ - [#2960](https://github.com/commercetools/merchant-center-application-kit/pull/2960) [`4377b3642`](https://github.com/commercetools/merchant-center-application-kit/commit/4377b3642c08fd9480016a287a18ada780191ad6) Thanks [@emmenko](https://github.com/emmenko)! - Update dependencies
236
+
237
+ ## 21.23.6
238
+
239
+ ## 21.23.5
240
+
241
+ ## 21.23.4
242
+
243
+ ## 21.23.3
244
+
245
+ ## 21.23.2
246
+
247
+ ## 21.23.1
248
+
249
+ ## 21.23.0
250
+
251
+ ## 21.22.1
252
+
253
+ ## 21.22.0
254
+
255
+ ## 21.21.2
256
+
257
+ ## 21.21.1
258
+
259
+ ## 21.21.0
260
+
261
+ ## 21.20.5
262
+
263
+ ## 21.20.4
264
+
265
+ ## 21.20.3
266
+
267
+ ## 21.20.2
268
+
269
+ ## 21.20.1
270
+
271
+ ## 21.20.0
272
+
273
+ ## 21.19.0
274
+
275
+ ## 21.18.1
276
+
277
+ ## 21.18.0
278
+
279
+ ### Patch Changes
280
+
281
+ - [#2837](https://github.com/commercetools/merchant-center-application-kit/pull/2837) [`3959ed2a0`](https://github.com/commercetools/merchant-center-application-kit/commit/3959ed2a0012077b6366c3a22c749fe7d6e74784) Thanks [@renovate](https://github.com/apps/renovate)! - Update all dependencies
282
+
283
+ ## 21.17.0
284
+
285
+ ## 21.16.0
286
+
287
+ ### Patch Changes
288
+
289
+ - [#2580](https://github.com/commercetools/merchant-center-application-kit/pull/2580) [`1c40c40c9`](https://github.com/commercetools/merchant-center-application-kit/commit/1c40c40c947574ba24b411c9376640bb18c489ac) Thanks [@renovate](https://github.com/apps/renovate)! - Update `@testing-library/react-hooks` package to version `8.0.0`.
290
+
291
+ - [#2826](https://github.com/commercetools/merchant-center-application-kit/pull/2826) [`11192ad4b`](https://github.com/commercetools/merchant-center-application-kit/commit/11192ad4bf186ff529255c68e95193a362308620) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies
292
+
293
+ ## 21.15.0
294
+
295
+ ## 21.14.3
296
+
297
+ ## 21.14.2
298
+
299
+ ### Patch Changes
300
+
301
+ - [#2776](https://github.com/commercetools/merchant-center-application-kit/pull/2776) [`00d9edcb4`](https://github.com/commercetools/merchant-center-application-kit/commit/00d9edcb49a144797ba3690db012e429e88a30fa) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies
302
+
303
+ ## 21.14.1
304
+
305
+ ### Patch Changes
306
+
307
+ - [#2797](https://github.com/commercetools/merchant-center-application-kit/pull/2797) [`03e9772de`](https://github.com/commercetools/merchant-center-application-kit/commit/03e9772def9106107a192c9c93a05f4e49e5f124) Thanks [@tdeekens](https://github.com/tdeekens)! - Remove `jest/no-jest-import` rule from ESLint configs.
308
+
309
+ This allows consumers of our configs to update to `eslint-plugin-jest` v27 which removes the rule as a breaking change.
310
+
311
+ ## 21.14.0
312
+
313
+ ## 21.13.1
314
+
315
+ ### Patch Changes
316
+
317
+ - [`482ad98ee`](https://github.com/commercetools/merchant-center-application-kit/commit/482ad98eeb4570a583d58d476a7902ffe6cc2a94) Thanks [@emmenko](https://github.com/emmenko)! - Nothing changed, the previous release `21.13.0` had an issue publishing to NPM so we're bumping versions to trigger a new release.
318
+
319
+ ## 21.13.0
320
+
321
+ ### Patch Changes
322
+
323
+ - [#2761](https://github.com/commercetools/merchant-center-application-kit/pull/2761) [`d012420e5`](https://github.com/commercetools/merchant-center-application-kit/commit/d012420e563b34a1678693f19905bdd79b2317e2) Thanks [@CarlosCortizasCT](https://github.com/CarlosCortizasCT)! - Update all dependencies
324
+
325
+ ## 21.12.0
326
+
327
+ ## 21.11.0
328
+
329
+ ## 21.10.0
330
+
331
+ ## 21.9.0
332
+
333
+ ### Patch Changes
334
+
335
+ - [#2705](https://github.com/commercetools/merchant-center-application-kit/pull/2705) [`abe2c475`](https://github.com/commercetools/merchant-center-application-kit/commit/abe2c475be2aff3781ac6151178aede1e0801f77) Thanks [@emmenko](https://github.com/emmenko)! - Update typescript dependencies
336
+
337
+ * [#2708](https://github.com/commercetools/merchant-center-application-kit/pull/2708) [`bc1137f1`](https://github.com/commercetools/merchant-center-application-kit/commit/bc1137f1e40cfc947245c7e9c23df896d8a40fd8) Thanks [@emmenko](https://github.com/emmenko)! - Update ESLint dependencies
338
+
339
+ - [#2702](https://github.com/commercetools/merchant-center-application-kit/pull/2702) [`69a1fe13`](https://github.com/commercetools/merchant-center-application-kit/commit/69a1fe13362188977c0a9df86754634fdc81a413) Thanks [@emmenko](https://github.com/emmenko)! - Update Babel dependencies
340
+
341
+ ## 21.8.1
342
+
343
+ ## 21.8.0
344
+
345
+ ### Patch Changes
346
+
347
+ - [#2661](https://github.com/commercetools/merchant-center-application-kit/pull/2661) [`43a9df21`](https://github.com/commercetools/merchant-center-application-kit/commit/43a9df2193000b49a0299c02d5218c50d71567ed) Thanks [@emmenko](https://github.com/emmenko)! - Drop the copyright year from the license files
348
+
349
+ ## 21.6.0
350
+
351
+ ### Patch Changes
352
+
353
+ - [#2555](https://github.com/commercetools/merchant-center-application-kit/pull/2555) [`0b7a3743`](https://github.com/commercetools/merchant-center-application-kit/commit/0b7a3743207172ace7f2b6893b9c7d61c351967b) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update all dependencies
354
+
355
+ ## 21.3.4
356
+
357
+ ### Patch Changes
358
+
359
+ - [#2546](https://github.com/commercetools/merchant-center-application-kit/pull/2546) [`dc76e5a9`](https://github.com/commercetools/merchant-center-application-kit/commit/dc76e5a9a7f875dadf2ed5a11c48a1ddff7b431c) Thanks [@renovate](https://github.com/apps/renovate)! - Upgrade dependencies
360
+
361
+ ## 21.3.0
362
+
363
+ ### Minor Changes
364
+
365
+ - [#2527](https://github.com/commercetools/merchant-center-application-kit/pull/2527) [`a6be74b0`](https://github.com/commercetools/merchant-center-application-kit/commit/a6be74b06223544e7ddae8bb71e3bac380b352f2) Thanks [@emmenko](https://github.com/emmenko)! - Add new ESLint config for Node.js projects. It includes TypeScript support.
366
+
367
+ ```bash
368
+ $ yarn add eslint @commercetools-backend/eslint-config-node
369
+ ```
370
+
371
+ ```js
372
+ // .eslintrc.js
373
+
374
+ module.exports = {
375
+ extends: ['@commercetools-backend/eslint-config-node'],
376
+ };
377
+ ```
378
+
379
+ ### Patch Changes
380
+
381
+ - [#2528](https://github.com/commercetools/merchant-center-application-kit/pull/2528) [`9235a721`](https://github.com/commercetools/merchant-center-application-kit/commit/9235a721df2be2ca5753994cd11312d577d0b293) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependencies
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) commercetools GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @commercetools-backend/eslint-config-node
2
+
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@commercetools-backend/eslint-config-node"><img src="https://badgen.net/npm/v/@commercetools-backend/eslint-config-node" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-backend/eslint-config-node"><img src="https://badgen.net/npm/v/@commercetools-backend/eslint-config-node/next" alt="Latest release (next dist-tag)" /></a> <a href="https://bundlephobia.com/result?p=@commercetools-backend/eslint-config-node"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-backend/eslint-config-node" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/merchant-center-application-kit/blob/main/LICENSE"><img src="https://badgen.net/github/license/commercetools/merchant-center-application-kit" alt="GitHub license" /></a>
5
+ </p>
6
+
7
+ ESLint config for Node.js projects.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ $ npm install --save @commercetools-backend/eslint-config-node
13
+
14
+ $ npx install-peerdeps --dev @commercetools-backend/eslint-config-node
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```js
20
+ // .eslintrc.js
21
+
22
+ module.exports = {
23
+ extends: ['@commercetools-backend/eslint-config-node'],
24
+ };
25
+ ```
@@ -0,0 +1,8 @@
1
+ const statusCode = {
2
+ error: 'error',
3
+ warn: 'warn',
4
+ off: 'off',
5
+ };
6
+ const allSupportedExtensions = ['.js', '.mjs', '.cjs', '.ts'];
7
+
8
+ module.exports = { statusCode, allSupportedExtensions };
package/index.js ADDED
@@ -0,0 +1,220 @@
1
+ // This is a workaround for https://github.com/eslint/eslint/issues/3458
2
+ require('@rushstack/eslint-patch/modern-module-resolution');
3
+
4
+ const { statusCode, allSupportedExtensions } = require('./helpers/eslint');
5
+
6
+ /**
7
+ * @type {import("eslint").Linter.Config}
8
+ */
9
+ module.exports = {
10
+ root: true,
11
+
12
+ parser: '@babel/eslint-parser',
13
+
14
+ parserOptions: {
15
+ sourceType: 'module',
16
+ requireConfigFile: false,
17
+ /**
18
+ * @type {import('@babel/core').TransformOptions}
19
+ */
20
+ babelOptions: {
21
+ presets: [['@babel/preset-env', { targets: { node: 'current' } }]],
22
+ },
23
+ },
24
+
25
+ env: {
26
+ browser: false,
27
+ commonjs: true,
28
+ es6: true,
29
+ jest: true,
30
+ node: true,
31
+ },
32
+
33
+ extends: [
34
+ 'eslint:recommended',
35
+ // https://github.com/mysticatea/eslint-plugin-n
36
+ 'plugin:n/recommended',
37
+ // https://github.com/benmosher/eslint-plugin-import
38
+ 'plugin:import/errors',
39
+ 'plugin:import/warnings',
40
+ // https://github.com/jest-community/eslint-plugin-jest
41
+ 'plugin:jest/recommended',
42
+ // NOTE: this should go last.
43
+ 'prettier',
44
+ ],
45
+
46
+ plugins: [
47
+ // https://github.com/import-js/eslint-plugin-import
48
+ 'import',
49
+ // https://github.com/jest-community/eslint-plugin-jest
50
+ 'jest',
51
+ // https://github.com/prettier/prettier-eslint
52
+ 'prettier',
53
+ ],
54
+
55
+ settings: {
56
+ 'import/resolver': {
57
+ node: {
58
+ extensions: allSupportedExtensions,
59
+ },
60
+ },
61
+ },
62
+
63
+ rules: {
64
+ // Nodejs
65
+ 'n/no-missing-import': statusCode.off,
66
+ 'n/no-unsupported-features/es-syntax': statusCode.off,
67
+
68
+ // NOTE: The regular rule does not support do-expressions. The equivalent rule of babel does.
69
+ 'no-unused-expressions': statusCode.off,
70
+
71
+ // Imports
72
+ 'import/extensions': [
73
+ statusCode.error,
74
+ {
75
+ js: 'never',
76
+ jsx: 'never',
77
+ ts: 'never',
78
+ tsx: 'never',
79
+ mjs: 'never',
80
+ json: 'always',
81
+ svg: 'always',
82
+ graphql: 'always',
83
+ },
84
+ ],
85
+ 'import/default': statusCode.off,
86
+ 'import/first': statusCode.error,
87
+ // TODO: enable this once there is support for `import type`
88
+ // 'import/order': statusCode.error,
89
+ 'import/named': statusCode.off,
90
+ 'import/namespace': statusCode.off,
91
+ 'import/no-extraneous-dependencies': statusCode.off,
92
+ 'import/no-named-as-default': statusCode.off,
93
+ 'import/no-named-as-default-member': statusCode.off,
94
+ 'import/no-unresolved': statusCode.error,
95
+
96
+ // Jest
97
+ 'jest/expect-expect': statusCode.off,
98
+ 'jest/no-identical-title': statusCode.warn,
99
+ 'jest/no-focused-tests': statusCode.error,
100
+ },
101
+
102
+ overrides: [
103
+ {
104
+ files: ['*.{spec,test}.*'],
105
+ env: {
106
+ 'jest/globals': true,
107
+ },
108
+ rules: {
109
+ 'n/no-extraneous-require': [
110
+ statusCode.error,
111
+ {
112
+ allowModules: ['jest-each', 'msw'],
113
+ },
114
+ ],
115
+ // https://github.com/jest-community/eslint-plugin-jest
116
+ 'jest/no-conditional-expect': statusCode.error,
117
+ 'jest/no-identical-title': statusCode.error,
118
+ 'jest/no-interpolation-in-snapshots': statusCode.error,
119
+ 'jest/no-jasmine-globals': statusCode.error,
120
+ 'jest/no-mocks-import': statusCode.error,
121
+ 'jest/valid-describe-callback': statusCode.error,
122
+ 'jest/valid-expect': statusCode.error,
123
+ 'jest/valid-expect-in-promise': statusCode.error,
124
+ 'jest/valid-title': statusCode.warn,
125
+ },
126
+ },
127
+ {
128
+ files: ['**/*.ts?(x)'],
129
+ parser: '@typescript-eslint/parser',
130
+ parserOptions: {
131
+ ecmaVersion: 2022,
132
+ sourceType: 'module',
133
+ // typescript-eslint specific options
134
+ warnOnUnsupportedTypeScriptVersion: true,
135
+ /**
136
+ * @type {import('@babel/core').TransformOptions}
137
+ */
138
+ babelOptions: {
139
+ presets: [
140
+ ['@babel/preset-env', { targets: { node: 'current' } }],
141
+ ['@babel/preset-typescript'],
142
+ ],
143
+ },
144
+ },
145
+ plugins: ['@typescript-eslint'],
146
+ rules: {
147
+ // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
148
+ 'default-case': statusCode.off,
149
+ // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
150
+ 'no-dupe-class-members': statusCode.off,
151
+ // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
152
+ 'no-undef': statusCode.off,
153
+
154
+ // Add TypeScript specific rules (and turn off ESLint equivalents)
155
+ '@typescript-eslint/consistent-type-assertions': statusCode.warn,
156
+ 'no-array-constructor': statusCode.off,
157
+ '@typescript-eslint/no-array-constructor': statusCode.warn,
158
+ 'no-redeclare': statusCode.off,
159
+ '@typescript-eslint/no-redeclare': statusCode.warn,
160
+ 'no-use-before-define': statusCode.off,
161
+ '@typescript-eslint/no-use-before-define': [
162
+ statusCode.error,
163
+ {
164
+ functions: false,
165
+ classes: false,
166
+ variables: false,
167
+ typedefs: false,
168
+ },
169
+ ],
170
+ 'no-unused-expressions': statusCode.off,
171
+ '@typescript-eslint/no-unused-expressions': [
172
+ statusCode.error,
173
+ {
174
+ allowShortCircuit: true,
175
+ allowTernary: true,
176
+ allowTaggedTemplates: true,
177
+ },
178
+ ],
179
+ 'no-unused-vars': statusCode.off,
180
+ '@typescript-eslint/no-unused-vars': [
181
+ statusCode.warn,
182
+ {
183
+ args: 'none',
184
+ ignoreRestSiblings: true,
185
+ },
186
+ ],
187
+ 'no-useless-constructor': statusCode.off,
188
+ '@typescript-eslint/no-useless-constructor': statusCode.warn,
189
+
190
+ // TypeScript
191
+ '@typescript-eslint/ban-types': statusCode.off,
192
+ '@typescript-eslint/naming-convention': statusCode.off,
193
+ '@typescript-eslint/consistent-type-definitions': statusCode.off,
194
+ '@typescript-eslint/no-explicit-any': statusCode.error,
195
+ '@typescript-eslint/no-var-requires': statusCode.off,
196
+ '@typescript-eslint/unbound-method': statusCode.off,
197
+ '@typescript-eslint/ban-ts-comment': statusCode.off,
198
+ '@typescript-eslint/explicit-function-return-type': statusCode.off,
199
+ '@typescript-eslint/explicit-member-accessibility': [
200
+ statusCode.error,
201
+ { accessibility: 'no-public' },
202
+ ],
203
+ '@typescript-eslint/no-require-imports': statusCode.off,
204
+ '@typescript-eslint/promise-function-async': statusCode.off,
205
+ },
206
+ settings: {
207
+ 'import/parsers': {
208
+ '@typescript-eslint/parser': allSupportedExtensions,
209
+ },
210
+ 'import/resolver': {
211
+ 'eslint-import-resolver-typescript': true,
212
+ typescript: {},
213
+ node: {
214
+ extensions: allSupportedExtensions,
215
+ },
216
+ },
217
+ },
218
+ },
219
+ ],
220
+ };
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@commercetools-backend/eslint-config-node",
3
+ "version": "0.0.0-FEC-157-preview-releases-20241126230331",
4
+ "description": "ESLint config for Node.js projects.",
5
+ "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/commercetools/merchant-center-application-kit.git",
9
+ "directory": "packages-backend/eslint-config-node"
10
+ },
11
+ "homepage": "https://docs.commercetools.com/merchant-center-customizations",
12
+ "keywords": [
13
+ "javascript",
14
+ "nodejs",
15
+ "toolkit",
16
+ "eslint"
17
+ ],
18
+ "license": "MIT",
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "dependencies": {
23
+ "@babel/core": "^7.22.17",
24
+ "@babel/eslint-parser": "^7.22.15",
25
+ "@babel/preset-env": "^7.22.15",
26
+ "@babel/preset-typescript": "^7.22.15",
27
+ "@rushstack/eslint-patch": "^1.3.3",
28
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
29
+ "@typescript-eslint/parser": "^5.62.0",
30
+ "eslint-config-prettier": "^8.10.0",
31
+ "eslint-import-resolver-typescript": "^3.6.0",
32
+ "eslint-plugin-import": "^2.28.1",
33
+ "eslint-plugin-jest": "^27.2.3",
34
+ "eslint-plugin-n": "^17.1.0",
35
+ "eslint-plugin-prettier": "^4.2.1"
36
+ },
37
+ "peerDependencies": {
38
+ "eslint": "8.x"
39
+ },
40
+ "devDependencies": {
41
+ "@tsconfig/node16": "^16.1.1",
42
+ "eslint": "8.57.0"
43
+ },
44
+ "engines": {
45
+ "node": "16.x || >=18.0.0"
46
+ }
47
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "@tsconfig/node16/tsconfig.json"
3
+ }