@mouse_484/eslint-config 5.10.38 → 5.10.39

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/bin/cli.js CHANGED
@@ -120,15 +120,17 @@ async function main() {
120
120
  )
121
121
 
122
122
  logger('Linting the project to verify setup')
123
- await runAgentCommand(
124
- packageManager.agent,
125
- 'run',
126
- ['lint:fix'],
127
- ).catch((error) => {
123
+ try {
124
+ await runAgentCommand(
125
+ packageManager.agent,
126
+ 'run',
127
+ ['lint:fix'],
128
+ )
129
+ } catch (error) {
128
130
  if (error instanceof Error) {
129
131
  logger(`Linting failed: ${error.message}`)
130
132
  }
131
- })
133
+ }
132
134
  }
133
135
 
134
136
  await main()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mouse_484/eslint-config",
3
3
  "type": "module",
4
- "version": "5.10.38",
4
+ "version": "5.10.39",
5
5
  "author": "mouse_484",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
@@ -24,7 +24,7 @@
24
24
  "typegen": "node scripts/typegen.js"
25
25
  },
26
26
  "dependencies": {
27
- "@antfu/eslint-config": "^9.0.0",
27
+ "@antfu/eslint-config": "^9.1.0",
28
28
  "baseline-browser-mapping": "^2.10.40",
29
29
  "eslint-plugin-better-tailwindcss": "^4.6.0",
30
30
  "package-manager-detector": "^1.6.0"
@@ -1,3 +1,4 @@
1
+ import { GLOB_SRC } from '@antfu/eslint-config'
1
2
  import { CASES } from '../const/cases.js'
2
3
  import { GLOB_D_TS, GLOB_MARKDOWN_CODE_BLOCK, GLOB_README } from '../const/glob.js'
3
4
  import { createConfigs } from '../lib/factory.js'
@@ -8,8 +9,9 @@ export default createConfigs({
8
9
  configs: [
9
10
  {
10
11
  name: 'general',
12
+ files: [GLOB_SRC],
11
13
  rules: {
12
- 'unicorn/prevent-abbreviations': [
14
+ 'unicorn/name-replacements': [
13
15
  'error',
14
16
  {
15
17
  allowList: {
@@ -48,7 +50,7 @@ export default createConfigs({
48
50
  '**/*env.d.ts',
49
51
  ],
50
52
  rules: {
51
- 'unicorn/prevent-abbreviations': 'off',
53
+ 'unicorn/name-replacements': 'off',
52
54
  },
53
55
  },
54
56
  {
package/src/index.js CHANGED
@@ -9,7 +9,7 @@ import typescript from './configs/typescript.js'
9
9
  import unicorn from './configs/unicorn.js'
10
10
 
11
11
  /** @type {import('.').mouse} */
12
- async function mouse(options, ...userConfigs) {
12
+ export default async function mouse(options, ...userConfigs) {
13
13
  options = {
14
14
  unicorn: {
15
15
  allRecommended: true,
@@ -62,7 +62,6 @@ async function mouse(options, ...userConfigs) {
62
62
  return composer
63
63
  }
64
64
 
65
- export default mouse
66
65
  export { mouse }
67
66
  export * from './const/glob.js'
68
67
  export * from '@antfu/eslint-config'
@@ -7,10 +7,10 @@
7
7
  */
8
8
  function createConfig(name, withOptions, config) {
9
9
  return (options) => {
10
- const allowApply = withOptions
11
- ? withOptions.every(key => key in options)
10
+ const canApply = withOptions
11
+ ? withOptions.every(key => Object.hasOwn(options, key))
12
12
  : true
13
- if (!allowApply) {
13
+ if (!canApply) {
14
14
  return []
15
15
  }
16
16
  return {