@1stg/eslint-config 7.0.0 → 8.0.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
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#229](https://github.com/1stG/configs/pull/229) [`6561a5e`](https://github.com/1stG/configs/commit/6561a5e7f0274753e5e447a17439a7ed54b7b7c4) Thanks [@JounQin](https://github.com/JounQin)! - chore: bump all upgradable (dev)Dependencies
8
+
9
+ ## 7.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#220](https://github.com/1stG/configs/pull/220) [`9268bd0`](https://github.com/1stG/configs/commit/9268bd0a5f8a23bcc865403d32651d81a892c674) Thanks [@JounQin](https://github.com/JounQin)! - fix(eslint): incorrect project setting for ts in md/mdx
14
+
3
15
  ## 7.0.0
4
16
 
5
17
  ### Major Changes
package/_util.js CHANGED
@@ -4,12 +4,12 @@ const { preferPrettier } = require('@1stg/config')
4
4
  const {
5
5
  isMonorepo,
6
6
  isPkgAvailable,
7
- monorepoPkgs,
7
+ getMonorepoPkgs,
8
8
  tryRequirePkg,
9
9
  } = require('@pkgr/utils')
10
10
 
11
- if (isMonorepo) {
12
- exports.allowModules = monorepoPkgs.reduce((acc, pkg) => {
11
+ if (isMonorepo()) {
12
+ exports.allowModules = getMonorepoPkgs().reduce((acc, pkg) => {
13
13
  const pkgJson = tryRequirePkg(path.resolve(pkg, 'package.json'))
14
14
  if (!pkgJson) {
15
15
  return acc
@@ -24,6 +24,8 @@ if (isMonorepo) {
24
24
  }, [])
25
25
  }
26
26
 
27
+ exports.isTsAvailable = isPkgAvailable('typescript')
28
+
27
29
  exports.isWebpackAvailable = isPkgAvailable('webpack')
28
30
 
29
31
  // https://webpack.js.org/api/module-variables/#__resourcequery-webpack-specific
package/base.js CHANGED
@@ -1,7 +1,8 @@
1
- const { isTsAvailable } = require('@pkgr/utils')
1
+ const { isPkgAvailable } = require('@pkgr/utils')
2
2
  const { getGlobals } = require('eslint-plugin-mdx')
3
3
 
4
4
  const {
5
+ isTsAvailable,
5
6
  isWebpackAvailable,
6
7
  magicNumbers,
7
8
  webpackSpecVars,
@@ -18,7 +19,7 @@ module.exports = {
18
19
  'plugin:promise/recommended',
19
20
  'plugin:regexp/recommended',
20
21
  'plugin:sonarjs/recommended',
21
- isTsAvailable && 'plugin:sonar/recommended',
22
+ isPkgAvailable('typescript') && 'plugin:sonar/recommended',
22
23
  'plugin:unicorn/recommended',
23
24
  'standard',
24
25
  ...prettierExtends,
package/overrides.js CHANGED
@@ -1,18 +1,9 @@
1
1
  const path = require('node:path')
2
2
 
3
3
  const { jsoncFiles, nonJsonRcFiles, preferPrettier } = require('@1stg/config')
4
- const {
5
- isAngularAvailable,
6
- isReactAvailable,
7
- isPkgAvailable,
8
- isSvelteAvailable,
9
- isTsAvailable,
10
- isVueAvailable,
11
- tryFile,
12
- tryPkg,
13
- } = require('@pkgr/utils')
14
-
15
- const { magicNumbers, prettierExtends } = require('./_util')
4
+ const { isPkgAvailable, tryFile, tryPkg } = require('@pkgr/utils')
5
+
6
+ const { isTsAvailable, magicNumbers, prettierExtends } = require('./_util')
16
7
 
17
8
  const configFile =
18
9
  tryFile(path.resolve('babel.config.js')) ||
@@ -172,7 +163,7 @@ const tsBase = {
172
163
  '@typescript-eslint/prefer-for-of': 2,
173
164
  '@typescript-eslint/prefer-function-type': 2,
174
165
  '@typescript-eslint/prefer-ts-expect-error': 2,
175
- '@typescript-eslint/sort-type-union-intersection-members': 2,
166
+ '@typescript-eslint/sort-type-constituents': 2,
176
167
  '@typescript-eslint/triple-slash-reference': [
177
168
  2,
178
169
  {
@@ -224,8 +215,14 @@ exports.ts = [
224
215
  },
225
216
  },
226
217
  {
227
- files: ['*.cts', '*.mts', '*.ts', '*.tsx'],
228
- excludedFiles: ['*.d.cts', '*.d.mts', '*.d.ts'],
218
+ files: '**/*.{md,mdx}/**/*.{cts,mts,ts,tsx}',
219
+ parserOptions: {
220
+ project: null,
221
+ },
222
+ },
223
+ {
224
+ files: '*.{cts,mts,ts,tsx}',
225
+ excludedFiles: ['**/*.{md,mdx}/**/*.{cts,mts,ts,tsx}', '*.d.{cts,mts,ts}'],
229
226
  extends: ['plugin:@typescript-eslint/recommended-requiring-type-checking'],
230
227
  rules: {
231
228
  '@typescript-eslint/no-floating-promises': [
@@ -540,6 +537,8 @@ exports.yml = exports.yaml = {
540
537
  extends: ['plugin:yml/recommended', 'plugin:yml/prettier'],
541
538
  }
542
539
 
540
+ const isReactAvailable = isPkgAvailable('react')
541
+
543
542
  exports.overrides = []
544
543
  // eslint-disable-next-line unicorn/prefer-spread
545
544
  .concat(
@@ -547,12 +546,12 @@ exports.overrides = []
547
546
  isTsAvailable && exports.ts,
548
547
  isReactAvailable && exports.react,
549
548
  isReactAvailable && exports.reactHooks,
550
- isReactAvailable && exports.reactTs,
549
+ isReactAvailable && isTsAvailable && exports.reactTs,
551
550
  // The order matters, the later should to be preferred
552
551
  exports.markup,
553
- isAngularAvailable && exports.angular,
554
- isVueAvailable && exports.vue,
555
- isSvelteAvailable && exports.svelte,
552
+ isPkgAvailable('@angular/core') && exports.angular,
553
+ isPkgAvailable('vue') && exports.vue,
554
+ isPkgAvailable('svelte') && exports.svelte,
556
555
  exports.md,
557
556
  exports.mdx,
558
557
  isPkgAvailable('jest') && exports.jest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1stg/eslint-config",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "Personal but Shareable ESLint Configuration for all 1stG.me projects",
5
5
  "repository": "git+https://github.com/1stG/configs.git",
6
6
  "homepage": "https://github.com/1stG/configs/tree/master/packages/eslint-config",
@@ -14,45 +14,45 @@
14
14
  "eslint": ">=8.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@1stg/config": "^0.2.1",
18
- "@angular-eslint/eslint-plugin": "^16.0.3",
19
- "@angular-eslint/eslint-plugin-template": "^16.0.3",
20
- "@angular-eslint/template-parser": "^16.0.3",
21
- "@babel/eslint-parser": "^7.22.5",
22
- "@babel/eslint-plugin": "^7.22.5",
23
- "@eslint-community/eslint-plugin-eslint-comments": "^3.2.1",
24
- "@pkgr/utils": "^2.4.1",
25
- "@typescript-eslint/eslint-plugin": "^5.60.0",
26
- "@typescript-eslint/parser": "^5.60.0",
17
+ "@1stg/config": "^0.2.2",
18
+ "@angular-eslint/eslint-plugin": "^17.1.1",
19
+ "@angular-eslint/eslint-plugin-template": "^17.1.1",
20
+ "@angular-eslint/template-parser": "^17.1.1",
21
+ "@babel/eslint-parser": "^7.23.3",
22
+ "@babel/eslint-plugin": "^7.23.5",
23
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.1.0",
24
+ "@pkgr/utils": "^3.0.0",
25
+ "@typescript-eslint/eslint-plugin": "^6.16.0",
26
+ "@typescript-eslint/parser": "^6.16.0",
27
27
  "angular-eslint-template-parser": "^0.1.1",
28
- "eslint-config-prettier": "^8.8.0",
28
+ "eslint-config-prettier": "^9.1.0",
29
29
  "eslint-config-standard": "^17.1.0",
30
30
  "eslint-config-standard-jsx": "^11.0.0",
31
31
  "eslint-config-standard-react": "^13.0.0",
32
32
  "eslint-formatter-friendly": "^7.0.0",
33
- "eslint-import-resolver-typescript": "^3.5.5",
34
- "eslint-plugin-css": "^0.8.0",
35
- "eslint-plugin-es-x": "^7.1.0",
36
- "eslint-plugin-import": "npm:eslint-plugin-i@^2.27.5",
37
- "eslint-plugin-jest": "^27.2.2",
38
- "eslint-plugin-jsdoc": "^46.2.6",
39
- "eslint-plugin-jsonc": "^2.9.0",
33
+ "eslint-import-resolver-typescript": "^3.6.1",
34
+ "eslint-plugin-css": "^0.8.1",
35
+ "eslint-plugin-es-x": "^7.5.0",
36
+ "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
37
+ "eslint-plugin-jest": "^27.6.0",
38
+ "eslint-plugin-jsdoc": "^46.9.1",
39
+ "eslint-plugin-jsonc": "^2.11.2",
40
40
  "eslint-plugin-markup": "^0.11.0",
41
- "eslint-plugin-mdx": "^2.1.0",
42
- "eslint-plugin-n": "^16.0.0",
43
- "eslint-plugin-prettier": "^4.2.1",
41
+ "eslint-plugin-mdx": "^2.3.0",
42
+ "eslint-plugin-n": "^16.6.0",
43
+ "eslint-plugin-prettier": "^5.1.2",
44
44
  "eslint-plugin-promise": "^6.1.1",
45
- "eslint-plugin-react": "^7.32.2",
45
+ "eslint-plugin-react": "^7.33.2",
46
46
  "eslint-plugin-react-hooks": "^4.6.0",
47
- "eslint-plugin-regexp": "^1.15.0",
47
+ "eslint-plugin-regexp": "^2.1.2",
48
48
  "eslint-plugin-simple-import-sort": "^10.0.0",
49
- "eslint-plugin-sonar": "^0.12.0",
50
- "eslint-plugin-sonarjs": "^0.19.0",
51
- "eslint-plugin-svelte": "^2.31.0",
52
- "eslint-plugin-toml": "^0.5.0",
53
- "eslint-plugin-unicorn": "^47.0.0",
54
- "eslint-plugin-vue": "^9.15.0",
55
- "eslint-plugin-yml": "^1.8.0"
49
+ "eslint-plugin-sonar": "^0.13.1",
50
+ "eslint-plugin-sonarjs": "^0.23.0",
51
+ "eslint-plugin-svelte": "^2.35.1",
52
+ "eslint-plugin-toml": "^0.8.0",
53
+ "eslint-plugin-unicorn": "^50.0.1",
54
+ "eslint-plugin-vue": "^9.19.2",
55
+ "eslint-plugin-yml": "^1.11.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"