@mouse_484/eslint-config 5.4.2 → 5.4.4

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.
Files changed (2) hide show
  1. package/bin/cli.js +14 -6
  2. package/package.json +4 -2
package/bin/cli.js CHANGED
@@ -24,6 +24,7 @@ function logger(message) {
24
24
  */
25
25
  function runAgentCommand(agent, command_, args_) {
26
26
  const { command, args } = resolveCommand(agent, command_, args_)
27
+ console.info(`Running command: ${command} ${args.join(' ')}`)
27
28
  return new Promise((resolve, reject) => {
28
29
  const child = spawn(
29
30
  command,
@@ -62,7 +63,7 @@ async function main() {
62
63
  await runAgentCommand(
63
64
  packageManager.agent,
64
65
  'execute',
65
- [PACKAGE_NAME.BASE],
66
+ ['-y', `${PACKAGE_NAME.BASE}@latest`],
66
67
  )
67
68
  logger('Modifying base config to custom config')
68
69
 
@@ -94,11 +95,17 @@ async function main() {
94
95
 
95
96
  logger('Updating config file')
96
97
  const configPath = path.join(cwd, `eslint.config.${packageJson.type === 'module' ? 'js' : 'mjs'}`)
97
- await writeFile(configPath, `
98
- import mouse from '${PACKAGE_NAME.CUSTOM}'
99
-
100
- export default mouse()
101
- `.trim(), 'utf8')
98
+ const config = await readFile(configPath, 'utf8')
99
+ await writeFile(
100
+ configPath,
101
+ config
102
+ .replace(
103
+ 'import antfu from \'@antfu/eslint-config\'',
104
+ 'import mouse from \'@mouse_484/eslint-config\'',
105
+ )
106
+ .replace('antfu', 'mouse'),
107
+ 'utf8',
108
+ )
102
109
 
103
110
  logger('Linting the project to verify setup')
104
111
  await runAgentCommand(
@@ -110,5 +117,6 @@ export default mouse()
110
117
  })
111
118
  }
112
119
 
120
+ console.info('---------------- Setting up @mouse_484/eslint-config ----------------')
113
121
  await main()
114
122
  console.info('---------------- Setup Complete ----------------')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mouse_484/eslint-config",
3
3
  "type": "module",
4
- "version": "5.4.2",
4
+ "version": "5.4.4",
5
5
  "author": "mouse_484",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/mouse484/config/tree/main/packages/eslint",
@@ -17,7 +17,9 @@
17
17
  ],
18
18
  "main": "src/index.js",
19
19
  "types": "src/index.d.ts",
20
- "bin": "bin/cli.js",
20
+ "bin": {
21
+ "setup": "./bin/cli.js"
22
+ },
21
23
  "scripts": {
22
24
  "typegen": "node scripts/typegen.js"
23
25
  },