xo 1.0.3 → 1.0.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/dist/lib/xo.js +8 -6
  2. package/package.json +2 -2
package/dist/lib/xo.js CHANGED
@@ -125,8 +125,7 @@ export class Xo {
125
125
  });
126
126
  this.xoConfig = [
127
127
  this.baseXoConfig,
128
- // Ensure resolved options do not mutate between runs
129
- ...structuredClone(flatOptions),
128
+ ...flatOptions,
130
129
  ];
131
130
  // Split off the TS rules in a special case, so that you won't get errors
132
131
  // for JS files when the TS rules are not in the config.
@@ -162,11 +161,14 @@ export class Xo {
162
161
  };
163
162
  // Apply TS rules to all files
164
163
  tsConfig.files = [tsFilesGlob];
165
- // Set the other rules to the original config
166
- config.rules = Object.fromEntries(otherRules);
164
+ const otherConfig = {
165
+ ...config,
166
+ // Set the other rules to the original config
167
+ rules: Object.fromEntries(otherRules),
168
+ };
167
169
  // These rules should still apply to all files
168
- config.files = [allFilesGlob];
169
- return [tsConfig, config];
170
+ otherConfig.files = [allFilesGlob];
171
+ return [tsConfig, otherConfig];
170
172
  });
171
173
  this.prettier = this.xoConfig.some(config => config.prettier);
172
174
  this.prettierConfig = await prettier.resolveConfig(flatConfigPath, { editorconfig: true }) ?? {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xo",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "JavaScript/TypeScript linter (ESLint wrapper) with great defaults",
5
5
  "license": "MIT",
6
6
  "repository": "xojs/xo",
@@ -25,7 +25,7 @@
25
25
  "build:watch": "tsc --watch",
26
26
  "clean": "rm -rf dist",
27
27
  "lint": "node dist/cli.js",
28
- "prepare": "npm run build",
28
+ "prepare": "npm run build && husky",
29
29
  "release": "np",
30
30
  "test": "npm run build && npm run lint && npm run test:setup && ava",
31
31
  "test:setup": "node scripts/setup-tests"