@foray1010/eslint-config 12.1.0 → 12.2.1

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,25 @@
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.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.2.0...@foray1010/eslint-config@12.2.1) (2024-03-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **deps:** update dependency eslint-plugin-simple-import-sort to v12 ([dc477c0](https://github.com/foray1010/common-presets/commit/dc477c0ab0abf72f7f3fe7c5d93f86079ed0a702))
11
+ - **deps:** update dependency eslint-plugin-unicorn to v51 ([cde249f](https://github.com/foray1010/common-presets/commit/cde249fa154fc4952e18d678cd523a19ab227ecf))
12
+ - **deps:** update dependency globals to v14 ([9eda897](https://github.com/foray1010/common-presets/commit/9eda8974ac7e3f65c04bbed29164c5b4b040d671))
13
+ - **deps:** update typescript-eslint monorepo to v7 ([49fe30c](https://github.com/foray1010/common-presets/commit/49fe30cdf0f156a2b21422998d4df554813833ce))
14
+
15
+ ## [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)
16
+
17
+ ### Features
18
+
19
+ - **eslint-config:** prefer promise style when using nodejs modules ([ff2b07e](https://github.com/foray1010/common-presets/commit/ff2b07ec726573f8e21b3b0ff54b069061591153))
20
+
21
+ ### Bug Fixes
22
+
23
+ - **deps:** update dependency eslint-plugin-unicorn to v50 ([aa474d6](https://github.com/foray1010/common-presets/commit/aa474d613a309319f0323ae4dcb32f6dd85f78e4))
24
+
6
25
  ## [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
26
 
8
27
  ### Features
package/bases/base.mjs CHANGED
@@ -1,6 +1,5 @@
1
1
  import js from '@eslint/js'
2
2
  import eslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-comments'
3
- // @ts-expect-error
4
3
  import { hasDep, isESM } from '@foray1010/common-presets-utils'
5
4
  import eslintPluginImport from 'eslint-plugin-import'
6
5
  import eslintPluginJest from 'eslint-plugin-jest'
@@ -38,7 +37,6 @@ async function generateTypeScriptConfig() {
38
37
  {
39
38
  files: typeScriptFileGlobs,
40
39
  languageOptions: {
41
- // @ts-expect-error
42
40
  parser: typescriptEslintParser,
43
41
  parserOptions: {
44
42
  // faster linting on cli
@@ -311,7 +309,7 @@ const baseConfig = [
311
309
  ...eslintPluginRegexp.configs['recommended']?.rules,
312
310
  ...Object.fromEntries(
313
311
  Object.entries(
314
- eslintPluginUnicorn.configs['recommended']?.rules ?? {},
312
+ eslintPluginUnicorn.configs['flat/recommended']?.rules ?? {},
315
313
  ).filter(([ruleName]) => {
316
314
  // only use a subset of recommended rules as other rules are too strict
317
315
  return (
@@ -411,7 +409,7 @@ const baseConfig = [
411
409
  destructuring: 'all',
412
410
  },
413
411
  ],
414
- // enable regexp strict mode
412
+ // enable regexp strict mode (use `v` flag instead when it is widely supported)
415
413
  'regexp/require-unicode-regexp': 'error',
416
414
  // use with `unicorn/throw-new-error`
417
415
  // disallow builtins to be created without `new` operator, to be consistent with es6 class syntax
package/bases/browser.mjs CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-expect-error
2
1
  import { hasDep } from '@foray1010/common-presets-utils'
3
2
  import restrictedGlobals from 'confusing-browser-globals'
4
3
  import eslintPluginCompat from 'eslint-plugin-compat'
@@ -38,7 +37,6 @@ const browserConfig = [
38
37
  ...globals.browser,
39
38
  ...globals.webextensions,
40
39
  // keep it until webpack has an official way to define env: https://github.com/webpack/webpack/issues/15833
41
- // @ts-expect-error
42
40
  process: 'readonly',
43
41
  },
44
42
  },
package/bases/node.mjs CHANGED
@@ -1,4 +1,3 @@
1
- // @ts-expect-error
2
1
  import { isESM } from '@foray1010/common-presets-utils'
3
2
  import eslintPluginN from 'eslint-plugin-n'
4
3
 
@@ -8,9 +7,7 @@ import eslintPluginN from 'eslint-plugin-n'
8
7
  const cjsConfig = {
9
8
  languageOptions: {
10
9
  globals: {
11
- // @ts-expect-error
12
10
  __dirname: 'readonly',
13
- // @ts-expect-error
14
11
  __filename: 'readonly',
15
12
  },
16
13
  },
@@ -25,11 +22,9 @@ const nodeConfig = [
25
22
  languageOptions: {
26
23
  globals: {
27
24
  // hack to mute no-undef error, and show n/prefer-global/buffer error instead
28
- // @ts-expect-error
29
- Buffer: 'writable',
25
+ Buffer: 'readonly',
30
26
  // hack to mute no-undef error, and show n/prefer-global/process error instead
31
- // @ts-expect-error
32
- process: 'writable',
27
+ process: 'readonly',
33
28
  },
34
29
  },
35
30
  rules: {
@@ -57,6 +52,10 @@ const nodeConfig = [
57
52
  'n/prefer-global/url': ['error', 'always'],
58
53
  // prefer global `URLSearchParams` to be isomorphic
59
54
  'n/prefer-global/url-search-params': ['error', 'always'],
55
+ // prefer `import { promises as dns } from 'node:dns'`
56
+ 'n/prefer-promises/dns': 'error',
57
+ // prefer `import { promises as fs } from 'node:fs'`
58
+ 'n/prefer-promises/fs': 'error',
60
59
  // make `process.exit()` expressions the same code path as `throw`
61
60
  'n/process-exit-as-throw': 'error',
62
61
  // 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.1",
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": {
@@ -23,8 +23,8 @@
23
23
  "@eslint-community/eslint-plugin-eslint-comments": "^4.1.0",
24
24
  "@eslint/js": "^8.53.0",
25
25
  "@foray1010/common-presets-utils": "^8.0.0",
26
- "@typescript-eslint/eslint-plugin": "^6.11.0",
27
- "@typescript-eslint/parser": "^6.11.0",
26
+ "@typescript-eslint/eslint-plugin": "^7.0.0",
27
+ "@typescript-eslint/parser": "^7.0.0",
28
28
  "confusing-browser-globals": "^1.0.11",
29
29
  "eslint-config-prettier": "^9.0.0",
30
30
  "eslint-import-resolver-typescript": "^3.6.1",
@@ -39,14 +39,14 @@
39
39
  "eslint-plugin-react": "^7.33.2",
40
40
  "eslint-plugin-react-hooks": "^4.6.0",
41
41
  "eslint-plugin-regexp": "^2.1.1",
42
- "eslint-plugin-simple-import-sort": "^10.0.0",
42
+ "eslint-plugin-simple-import-sort": "^12.0.0",
43
43
  "eslint-plugin-testing-library": "^6.1.2",
44
- "eslint-plugin-unicorn": "^49.0.0",
45
- "globals": "^13.23.0"
44
+ "eslint-plugin-unicorn": "^51.0.0",
45
+ "globals": "^14.0.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.5",
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": "8dc6648dafb37c604313d8e06a340044483d58f1"
73
73
  }