xo 1.2.2 → 1.2.3

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.
@@ -7,6 +7,7 @@ Only applies to options defined as an Array.
7
7
  */
8
8
  export declare const tsExtensions: string[];
9
9
  export declare const jsExtensions: string[];
10
+ export declare const frameworkExtensions: string[];
10
11
  export declare const jsFilesGlob: string;
11
12
  export declare const tsFilesGlob: string;
12
13
  export declare const allExtensions: string[];
@@ -16,9 +16,10 @@ Only applies to options defined as an Array.
16
16
  */
17
17
  export const tsExtensions = ['ts', 'tsx', 'cts', 'mts'];
18
18
  export const jsExtensions = ['js', 'jsx', 'mjs', 'cjs'];
19
+ export const frameworkExtensions = ['vue', 'svelte', 'astro'];
19
20
  export const jsFilesGlob = `**/*.{${jsExtensions.join(',')}}`;
20
21
  export const tsFilesGlob = `**/*.{${tsExtensions.join(',')}}`;
21
- export const allExtensions = [...jsExtensions, ...tsExtensions];
22
+ export const allExtensions = [...jsExtensions, ...tsExtensions, ...frameworkExtensions];
22
23
  export const allFilesGlob = `**/*.{${allExtensions.join(',')}}`;
23
24
  export const moduleName = 'xo';
24
25
  export const tsconfigDefaults = {
@@ -68,7 +68,8 @@ export function xoToEslintConfig(flatXoConfig, { prettierOptions = {} } = {}) {
68
68
  }
69
69
  else {
70
70
  // Validate that Prettier options match other `xoConfig` options.
71
- if ((xoConfigItem.semicolon && prettierOptions.semi === false) ?? (!xoConfigItem.semicolon && prettierOptions.semi === true)) {
71
+ /* eslint-disable-next-line */
72
+ if ((xoConfigItem.semicolon && prettierOptions.semi === false) || (!xoConfigItem.semicolon && prettierOptions.semi === true)) {
72
73
  throw new Error(`The Prettier config \`semi\` is ${prettierOptions.semi} while Xo \`semicolon\` is ${xoConfigItem.semicolon}, also check your .editorconfig for inconsistencies.`);
73
74
  }
74
75
  if (((xoConfigItem.space ?? typeof xoConfigItem.space === 'number') && prettierOptions.useTabs === true) || (!xoConfigItem.space && prettierOptions.useTabs === false)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xo",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "JavaScript/TypeScript linter (ESLint wrapper) with great defaults",
5
5
  "license": "MIT",
6
6
  "repository": "xojs/xo",
package/readme.md CHANGED
@@ -108,7 +108,7 @@ Simply run `$ npm init xo` (with any options) to add XO to create an `xo.config.
108
108
 
109
109
  ## Config
110
110
 
111
- You can configure XO options by creating an `xo.config.js` or an `xo.config.ts` file in the root directory of your project, or you can add an `xo` field to your `package.json`. XO supports all js/ts file extensions (js,cjs,mjs,ts,cts,mts) automatically. A XO config is an extension of ESLint's Flat Config. Like ESLint, an XO config exports an array of XO config objects. XO config objects extend [ESLint Configuration Objects](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects). This means all the available configuration params for ESLint also work for `XO`. However, `XO` enhances and adds extra params to the configuration objects to make them easier to work with.
111
+ You can configure XO options by creating an `xo.config.js` or an `xo.config.ts` file in the root directory of your project, or you can add an `xo` field to your `package.json`. XO supports all js/ts file extensions (js,cjs,mjs,ts,cts,mts) and popular framework extensions (vue,svelte,astro) automatically. A XO config is an extension of ESLint's Flat Config. Like ESLint, an XO config exports an array of XO config objects. XO config objects extend [ESLint Configuration Objects](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects). This means all the available configuration params for ESLint also work for `XO`. However, `XO` enhances and adds extra params to the configuration objects to make them easier to work with.
112
112
 
113
113
  ### Config types
114
114
 
@@ -137,7 +137,7 @@ export default [...] satisfies import('xo').FlatXoConfig
137
137
  ### files
138
138
 
139
139
  Type: `string | string[] | undefined`\
140
- Default: `**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}`
140
+ Default: `**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx,vue,svelte,astro}`
141
141
 
142
142
  A glob or array of glob strings which the config object will apply. By default `XO` will apply the configuration to [all files](lib/constants.ts).
143
143