Skip to content

Commit 16cd660

Browse files
committed
feat: add js-docs
1 parent 2872619 commit 16cd660

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ You can fine-tune module detection by overriding it, the `defineConfig` function
5757
```typescript
5858
interface Options {
5959
react?: boolean; // controls react, react-hooks, jsx/a11y plugins
60-
typescript?: { // controls typescript plugin
61-
projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number; // https://typescript-eslint.io/packages/parser#projectservice
62-
tsconfigRootDir?: string // https://typescript-eslint.io/packages/parser#tsconfigrootdir
63-
};
60+
typescript?: ParserOptions // https://typescript-eslint.io/packages/parser#configuration
6461
node?: boolean; // controls node plugin
6562
sort?: boolean; // controls perfectionist plugin
6663
strict?: boolean; // controls strict rules

src/modules/tests.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function tests(options = {}) {
2525

2626
'max-lines-per-function': 'off',
2727
'no-sparse-arrays': 'off',
28+
'no-empty-function': 'off',
2829

2930
...predicate(options.react, {
3031
'react/jsx-no-constructed-context-values': 'off',
@@ -36,6 +37,7 @@ function tests(options = {}) {
3637
'@typescript-eslint/unbound-method': 'off',
3738
'@typescript-eslint/no-empty-function': 'off',
3839
'@typescript-eslint/no-floating-promises': 'off',
40+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
3941
}),
4042
},
4143
};

src/modules/typescript.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ function typescript(options = {}) {
218218
'react/jsx-no-useless-fragment': 'off', // Need useless-fragment for JSX return type
219219

220220
// Conflicts with @typescript-eslint
221+
'no-empty-function': 'off',
221222
'default-case': 'off',
222223
'import/named': 'off',
223224
'import/namespace': 'off',

src/option.d.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,93 @@ interface ProjectService {
88
}
99

1010
export interface Options extends Linter.Config {
11+
/**
12+
* @default true if you have `react` or `react-dom` in your dependencies
13+
* Controls react plugin.
14+
*/
1115
react?: boolean;
16+
/**
17+
* @default true
18+
*/
1219
sort?: boolean;
20+
/**
21+
* @default true if you have `next` in your dependencies
22+
* Controls next plugin.
23+
*/
1324
next?: boolean;
25+
/**
26+
* @default true if you have `tailwind` in your dependencies
27+
* Controls tailwind plugin.
28+
*/
1429
tailwind?: boolean | { callees: string[] };
30+
/**
31+
* @default false
32+
* Controls [node plugin](https://www.npmjs.com/package/eslint-plugin-n).
33+
*/
1534
node?: boolean;
35+
/**
36+
* @default false
37+
* Enables all strict rules.
38+
*/
1639
strict?: boolean;
40+
/**
41+
* @default true
42+
* Controls [import plugin](https://www.npmjs.com/package/eslint-plugin-import-x).
43+
*/
1744
import?: boolean | { internalRegExp?: string; lifetime?: number; projects?: string | string[] };
45+
/**
46+
* @default true if you have `type: module` in your `package.json`.
47+
*/
1848
esm?: boolean;
49+
/**
50+
* @default true if you have one of `jest`, `vitest`, `cypress`, `playwright`, `storybook`, `prettier` in your dependencies.
51+
* Controls [test plugin](https://www.npmjs.com/package/eslint-plugin-jest-formatting).
52+
*/
1953
test?: boolean;
54+
/**
55+
* @default true if you have `jest` in your dependencies.
56+
* Controls [jest plugin](https://www.npmjs.com/package/eslint-plugin-jest).
57+
*/
2058
jest?: boolean;
59+
/**
60+
* @default true if you have `vitest` in your dependencies.
61+
* Controls [vitest plugin](https://www.npmjs.com/package/eslint-plugin-vitest).
62+
*/
2163
vitest?: boolean;
64+
/**
65+
* @default true if you have `cypress` in your dependencies.
66+
* Controls [cypress plugin](https://www.npmjs.com/package/eslint-plugin-cypress).
67+
*/
2268
cypress?: boolean;
69+
/**
70+
* @default true if you have `storybook` in your dependencies.
71+
* Controls [storybook plugin](https://www.npmjs.com/package/eslint-plugin-storybook).
72+
*/
2373
storybook?: boolean;
74+
/**
75+
* @default true if you have `prettier` in your dependencies.
76+
* Controls [prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier).
77+
*/
2478
prettier?: boolean;
79+
/**
80+
* @default true if you have `playwright` in your dependencies.
81+
* Controls [playwright plugin](https://www.npmjs.com/package/eslint-plugin-playwright).
82+
*/
2583
playwright?: boolean;
84+
/**
85+
* @default true if you have `typescript` in your dependencies.
86+
* Controls [typescript plugin](https://www.npmjs.com/package/typescript-eslint).
87+
*/
2688
typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number };
89+
/**
90+
* @default false
91+
* Disables expensive rules.
92+
*/
2793
disableExpensiveRules?: boolean;
94+
/**
95+
* @default []
96+
* List of globs to ignore.
97+
*/
2898
ignores?: string[];
2999
}
30100

0 commit comments

Comments
 (0)