-
Notifications
You must be signed in to change notification settings - Fork 0
/
export.js
38 lines (35 loc) · 1.1 KB
/
export.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { base } from "./base.js";
import { html } from "./html.js";
import { javascriptAndTypescript } from "./javascript-and-typescript.js";
import { json } from "./json.js";
import { react } from "./react.js";
/**
* The @connorjs ESLint config.
*
* @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile}
*/
const connorjsConfig = [
...javascriptAndTypescript,
...react,
...json({ packageJson: true }),
...html,
...base, // Last to apply to all file types
];
// eslint-disable-next-line import/no-default-export -- ESLint configs use default export (community practice)
export default connorjsConfig;
/**
* Creates a custom `@connorjs` ESLint config.
*
* @param options - Configuration options.
* @param options.html {boolean=true} - Enables HTML.
* @param options.packageJson {boolean=true} - Applies `package.json` sorting rules.
*/
export function createConnorjsConfig(options = {}) {
return [
...javascriptAndTypescript,
...react,
...json({ packageJson: options.packageJson ?? true }),
...((options.html ?? true) ? html : []),
...base, // Last to apply to all file types
];
}