@foray1010/eslint-config 12.1.0 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [12.2.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.1.0...@foray1010/eslint-config@12.2.0) (2024-01-20)
7
+
8
+ ### Features
9
+
10
+ - **eslint-config:** prefer promise style when using nodejs modules ([ff2b07e](https://github.com/foray1010/common-presets/commit/ff2b07ec726573f8e21b3b0ff54b069061591153))
11
+
12
+ ### Bug Fixes
13
+
14
+ - **deps:** update dependency eslint-plugin-unicorn to v50 ([aa474d6](https://github.com/foray1010/common-presets/commit/aa474d613a309319f0323ae4dcb32f6dd85f78e4))
15
+
6
16
  ## [12.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.0.0...@foray1010/eslint-config@12.1.0) (2023-11-17)
7
17
 
8
18
  ### Features
package/bases/base.mjs CHANGED
@@ -311,7 +311,7 @@ const baseConfig = [
311
311
  ...eslintPluginRegexp.configs['recommended']?.rules,
312
312
  ...Object.fromEntries(
313
313
  Object.entries(
314
- eslintPluginUnicorn.configs['recommended']?.rules ?? {},
314
+ eslintPluginUnicorn.configs['flat/recommended']?.rules ?? {},
315
315
  ).filter(([ruleName]) => {
316
316
  // only use a subset of recommended rules as other rules are too strict
317
317
  return (
@@ -411,7 +411,7 @@ const baseConfig = [
411
411
  destructuring: 'all',
412
412
  },
413
413
  ],
414
- // enable regexp strict mode
414
+ // enable regexp strict mode (use `v` flag instead when it is widely supported)
415
415
  'regexp/require-unicode-regexp': 'error',
416
416
  // use with `unicorn/throw-new-error`
417
417
  // disallow builtins to be created without `new` operator, to be consistent with es6 class syntax
package/bases/browser.mjs CHANGED
@@ -38,7 +38,6 @@ const browserConfig = [
38
38
  ...globals.browser,
39
39
  ...globals.webextensions,
40
40
  // keep it until webpack has an official way to define env: https://github.com/webpack/webpack/issues/15833
41
- // @ts-expect-error
42
41
  process: 'readonly',
43
42
  },
44
43
  },
package/bases/node.mjs CHANGED
@@ -8,9 +8,7 @@ import eslintPluginN from 'eslint-plugin-n'
8
8
  const cjsConfig = {
9
9
  languageOptions: {
10
10
  globals: {
11
- // @ts-expect-error
12
11
  __dirname: 'readonly',
13
- // @ts-expect-error
14
12
  __filename: 'readonly',
15
13
  },
16
14
  },
@@ -25,11 +23,9 @@ const nodeConfig = [
25
23
  languageOptions: {
26
24
  globals: {
27
25
  // hack to mute no-undef error, and show n/prefer-global/buffer error instead
28
- // @ts-expect-error
29
- Buffer: 'writable',
26
+ Buffer: 'readonly',
30
27
  // hack to mute no-undef error, and show n/prefer-global/process error instead
31
- // @ts-expect-error
32
- process: 'writable',
28
+ process: 'readonly',
33
29
  },
34
30
  },
35
31
  rules: {
@@ -57,6 +53,10 @@ const nodeConfig = [
57
53
  'n/prefer-global/url': ['error', 'always'],
58
54
  // prefer global `URLSearchParams` to be isomorphic
59
55
  'n/prefer-global/url-search-params': ['error', 'always'],
56
+ // prefer `import { promises as dns } from 'node:dns'`
57
+ 'n/prefer-promises/dns': 'error',
58
+ // prefer `import { promises as fs } from 'node:fs'`
59
+ 'n/prefer-promises/fs': 'error',
60
60
  // make `process.exit()` expressions the same code path as `throw`
61
61
  'n/process-exit-as-throw': 'error',
62
62
  // enforce shebang on the entry bin file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@foray1010/eslint-config",
4
- "version": "12.1.0",
4
+ "version": "12.2.0",
5
5
  "homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
6
6
  "bugs": "https://github.com/foray1010/common-presets/issues",
7
7
  "repository": {
@@ -41,12 +41,12 @@
41
41
  "eslint-plugin-regexp": "^2.1.1",
42
42
  "eslint-plugin-simple-import-sort": "^10.0.0",
43
43
  "eslint-plugin-testing-library": "^6.1.2",
44
- "eslint-plugin-unicorn": "^49.0.0",
44
+ "eslint-plugin-unicorn": "^50.0.1",
45
45
  "globals": "^13.23.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/confusing-browser-globals": "1.0.3",
49
- "@types/eslint": "8.44.7",
49
+ "@types/eslint": "8.56.2",
50
50
  "@types/eslint__js": "8.42.3"
51
51
  },
52
52
  "peerDependencies": {
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "42c44850b5cf45044e373ab543d4bb83766cd678"
72
+ "gitHead": "46fd1d0f56467d4b461f6264eabd040712989a7e"
73
73
  }