xo 0.61.0-2 → 0.61.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.
@@ -56,12 +56,14 @@ export async function handleTsconfig({ cwd, files }) {
56
56
  delete tsConfig.exclude;
57
57
  delete tsConfig.files;
58
58
  tsConfig.files = unincludedFiles;
59
- try {
60
- await fs.mkdir(path.dirname(fallbackTsConfigPath), { recursive: true });
61
- await fs.writeFile(fallbackTsConfigPath, JSON.stringify(tsConfig, null, 2));
62
- }
63
- catch (error) {
64
- console.error(error);
59
+ if (unincludedFiles.length > 0) {
60
+ try {
61
+ await fs.mkdir(path.dirname(fallbackTsConfigPath), { recursive: true });
62
+ await fs.writeFile(fallbackTsConfigPath, JSON.stringify(tsConfig, null, 2));
63
+ }
64
+ catch (error) {
65
+ console.error(error);
66
+ }
65
67
  }
66
68
  return { unincludedFiles, fallbackTsConfigPath };
67
69
  }
@@ -1,7 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import process from 'node:process';
3
3
  import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
4
- import pick from 'lodash.pick';
5
4
  import arrify from 'arrify';
6
5
  import { moduleName } from './constants.js';
7
6
  /**
@@ -34,21 +33,7 @@ export async function resolveXoConfig(options) {
34
33
  options.filePath &&= path.resolve(options.cwd, options.filePath);
35
34
  const searchPath = options.filePath ?? options.cwd;
36
35
  let { config: flatOptions = [], filepath: flatConfigPath = '', } = await flatConfigExplorer.search(searchPath) ?? {};
37
- const globalKeys = [
38
- 'ignores',
39
- 'settings',
40
- 'parserOptions',
41
- 'prettier',
42
- 'semicolon',
43
- 'space',
44
- 'rules',
45
- 'env',
46
- 'extension',
47
- 'files',
48
- 'plugins',
49
- 'react',
50
- ];
51
- flatOptions = arrify(flatOptions).map(config => pick(config, globalKeys));
36
+ flatOptions = arrify(flatOptions);
52
37
  return {
53
38
  flatOptions,
54
39
  flatConfigPath,
package/dist/lib/xo.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import os from 'node:os';
3
3
  import process from 'node:process';
4
4
  import { ESLint } from 'eslint';
5
- import findCacheDir from 'find-cache-dir';
5
+ import findCacheDirectory from 'find-cache-directory';
6
6
  import { globby } from 'globby';
7
7
  import arrify from 'arrify';
8
8
  import defineLazyProperty from 'define-lazy-prop';
@@ -109,7 +109,7 @@ export class Xo {
109
109
  this.linterOptions.cwd = path.resolve(process.cwd(), this.linterOptions.cwd);
110
110
  }
111
111
  const backupCacheLocation = path.join(os.tmpdir(), cacheDirName);
112
- this.cacheLocation = findCacheDir({ name: cacheDirName, cwd: this.linterOptions.cwd }) ?? backupCacheLocation;
112
+ this.cacheLocation = findCacheDirectory({ name: cacheDirName, cwd: this.linterOptions.cwd }) ?? backupCacheLocation;
113
113
  }
114
114
  /**
115
115
  Sets the XO config on the XO instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xo",
3
- "version": "0.61.0-2",
3
+ "version": "0.61.0",
4
4
  "description": "JavaScript/TypeScript linter (ESLint wrapper) with great defaults",
5
5
  "license": "MIT",
6
6
  "repository": "xojs/xo",
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "sideEffects": false,
20
20
  "engines": {
21
- "node": ">=18.20"
21
+ "node": ">=20.17"
22
22
  },
23
23
  "scripts": {
24
24
  "build": "npm run clean && tsc",
@@ -65,55 +65,53 @@
65
65
  "typescript"
66
66
  ],
67
67
  "dependencies": {
68
- "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
68
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
69
69
  "@sindresorhus/tsconfig": "^7.0.0",
70
70
  "@stylistic/eslint-plugin": "^4.2.0",
71
- "@typescript-eslint/parser": "^8.29.0",
71
+ "@typescript-eslint/parser": "^8.32.1",
72
72
  "arrify": "^3.0.0",
73
73
  "cosmiconfig": "^9.0.0",
74
74
  "define-lazy-prop": "^3.0.0",
75
- "eslint": "^9.23.0",
76
- "eslint-config-prettier": "^10.1.1",
75
+ "eslint": "^9.27.0",
76
+ "eslint-config-prettier": "^10.1.5",
77
77
  "eslint-config-xo-react": "^0.28.0",
78
78
  "eslint-config-xo-typescript": "^7.0.0",
79
79
  "eslint-formatter-pretty": "^6.0.1",
80
80
  "eslint-plugin-ava": "^15.0.1",
81
- "eslint-plugin-import-x": "^4.10.0",
82
- "eslint-plugin-n": "^17.17.0",
81
+ "eslint-plugin-import-x": "^4.12.2",
82
+ "eslint-plugin-n": "^17.18.0",
83
83
  "eslint-plugin-no-use-extend-native": "^0.7.2",
84
- "eslint-plugin-prettier": "^5.2.6",
84
+ "eslint-plugin-prettier": "^5.4.0",
85
85
  "eslint-plugin-promise": "^7.2.1",
86
- "eslint-plugin-unicorn": "^58.0.0",
87
- "find-cache-dir": "^5.0.0",
86
+ "eslint-plugin-unicorn": "^59.0.1",
88
87
  "get-stdin": "^9.0.0",
89
- "get-tsconfig": "^4.10.0",
90
- "globals": "^16.0.0",
88
+ "get-tsconfig": "^4.10.1",
89
+ "globals": "^16.1.0",
91
90
  "globby": "^14.1.0",
92
- "lodash.pick": "^4.4.0",
93
91
  "meow": "^13.2.0",
94
92
  "micromatch": "^4.0.8",
95
93
  "open-editor": "^5.1.0",
96
94
  "path-exists": "^5.0.0",
97
95
  "prettier": "^3.5.3",
98
- "type-fest": "^4.39.1",
99
- "typescript-eslint": "^8.29.0"
96
+ "type-fest": "^4.41.0",
97
+ "typescript-eslint": "^8.32.1"
100
98
  },
101
99
  "devDependencies": {
102
- "@commitlint/cli": "^19.8.0",
103
- "@commitlint/config-conventional": "^19.8.0",
100
+ "@commitlint/cli": "^19.8.1",
101
+ "@commitlint/config-conventional": "^19.8.1",
104
102
  "@types/eslint": "9.6.1",
105
- "@types/lodash.pick": "^4.4.9",
106
103
  "@types/micromatch": "^4.0.9",
107
104
  "@types/prettier": "^3.0.0",
108
- "ava": "^6.2.0",
109
- "dedent": "^1.5.3",
110
- "execa": "^9.5.2",
105
+ "ava": "^6.3.0",
106
+ "dedent": "^1.6.0",
107
+ "execa": "^9.5.3",
108
+ "find-cache-directory": "^6.0.0",
111
109
  "husky": "^9.1.7",
112
- "lint-staged": "^15.5.0",
110
+ "lint-staged": "^16.0.0",
113
111
  "np": "^10.2.0",
114
112
  "npm-package-json-lint": "^8.0.0",
115
113
  "npm-package-json-lint-config-default": "^7.0.1",
116
- "prettier-plugin-packagejson": "^2.5.10",
114
+ "prettier-plugin-packagejson": "^2.5.14",
117
115
  "temp-dir": "^3.0.0",
118
116
  "xo": "file:."
119
117
  },
package/readme.md CHANGED
@@ -96,7 +96,7 @@ $ xo --help
96
96
  - Space after keyword `if (condition) {}`
97
97
  - Always `===` instead of `==`
98
98
 
99
- Check out an [example](index.js) and the [ESLint rules](https://github.com/xojs/eslint-config-xo/blob/main/index.js).
99
+ Check out an [example](index.ts) and the [ESLint rules](https://github.com/xojs/eslint-config-xo/blob/main/index.js).
100
100
 
101
101
  ## Workflow
102
102
 
@@ -192,7 +192,7 @@ If the Prettier option is set to `compat`, instead of formatting your code autom
192
192
  Type: `boolean`\
193
193
  Default: `false`
194
194
 
195
- Adds `eslint-config-plugin-react`, `eslint-plugin-react-hooks`, and `eslint-config-xo-react` to get all the React best practices applied automatically.
195
+ Adds `eslint-plugin-react`, `eslint-plugin-react-hooks`, and `eslint-config-xo-react` to get all the React best practices applied automatically.
196
196
 
197
197
  ## TypeScript
198
198