Skip to content

Commit 02e8e44

Browse files
committed
Move rules from XO
1 parent 9ca6ad4 commit 02e8e44

11 files changed

Lines changed: 1073 additions & 164 deletions

eslint.config.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
import eslintConfigXo from './index.js';
22

3+
const config = eslintConfigXo();
4+
35
export default [
4-
...eslintConfigXo(),
6+
...config,
7+
{
8+
ignores: ['test/fixture.ts', 'index.d.ts'],
9+
},
10+
{
11+
files: ['eslint.config.js'],
12+
rules: {
13+
'import-x/no-anonymous-default-export': 'off',
14+
},
15+
},
516
{
6-
ignores: ['test/fixture.ts'],
17+
files: ['index.js'],
18+
rules: {
19+
'n/prefer-global/process': 'off',
20+
},
721
},
822
];

index.d.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import {type Linter} from 'eslint';
2+
3+
export const tsExtensions: string[];
4+
export const jsExtensions: string[];
5+
export const frameworkExtensions: string[];
6+
export const allExtensions: string[];
7+
8+
export const tsFilesGlob: string;
9+
export const jsFilesGlob: string;
10+
export const allFilesGlob: string;
11+
12+
export const defaultIgnores: string[];
13+
14+
export const typescriptParser: Linter.Parser;
15+
16+
export type Options = {
17+
/**
18+
Use browser globals instead of Node.js globals.
19+
20+
@default false
21+
*/
22+
browser?: boolean;
23+
24+
/**
25+
Use spaces for indentation instead of tabs.
26+
27+
Set to `true` for 2 spaces, or a number for a custom count.
28+
29+
@default false
30+
*/
31+
space?: boolean | number;
32+
33+
/**
34+
Use semicolons at the end of statements.
35+
36+
@default true
37+
*/
38+
semicolon?: boolean;
39+
};
40+
41+
/**
42+
ESLint shareable config for XO with support for JavaScript and TypeScript.
43+
44+
@returns An array of ESLint flat config objects.
45+
*/
46+
export default function eslintConfigXo(options?: Options): Linter.Config[];

0 commit comments

Comments
 (0)