@ocavue/eslint-config 2.16.0 → 2.18.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.
- package/README.md +32 -22
- package/dist/antfu.d.ts +2 -0
- package/dist/antfu.js +15 -0
- package/dist/basic.d.ts +2 -0
- package/dist/basic.js +20 -0
- package/dist/ignores.d.ts +2 -0
- package/dist/ignores.js +8 -0
- package/dist/imports.d.ts +2 -0
- package/dist/imports.js +49 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +27 -0
- package/dist/markdown.d.ts +2 -0
- package/dist/markdown.js +41 -0
- package/dist/no-only-tests.d.ts +2 -0
- package/dist/no-only-tests.js +14 -0
- package/dist/options.d.ts +21 -0
- package/dist/options.js +7 -0
- package/dist/package-json.d.ts +5 -0
- package/dist/package-json.js +70 -0
- package/dist/{src/prettier.d.ts → prettier.d.ts} +2 -2
- package/{src → dist}/prettier.js +9 -13
- package/dist/react.d.ts +2 -0
- package/dist/react.js +34 -0
- package/dist/shared.d.ts +23 -0
- package/dist/shared.js +49 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +1 -0
- package/dist/typescript.d.ts +4 -0
- package/dist/typescript.js +112 -0
- package/dist/unicorn.d.ts +2 -0
- package/dist/unicorn.js +71 -0
- package/dist/vue.d.ts +2 -0
- package/dist/vue.js +33 -0
- package/package.json +20 -24
- package/dist/eslint.config.d.ts +0 -3
- package/dist/eslint.config.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/src/antfu.d.ts +0 -2
- package/dist/src/antfu.d.ts.map +0 -1
- package/dist/src/basic.d.ts +0 -2
- package/dist/src/basic.d.ts.map +0 -1
- package/dist/src/ignores.d.ts +0 -2
- package/dist/src/ignores.d.ts.map +0 -1
- package/dist/src/imports.d.ts +0 -2
- package/dist/src/imports.d.ts.map +0 -1
- package/dist/src/markdown.d.ts +0 -2
- package/dist/src/markdown.d.ts.map +0 -1
- package/dist/src/no-only-tests.d.ts +0 -2
- package/dist/src/no-only-tests.d.ts.map +0 -1
- package/dist/src/package-json.d.ts +0 -5
- package/dist/src/package-json.d.ts.map +0 -1
- package/dist/src/prettier.d.ts.map +0 -1
- package/dist/src/react.d.ts +0 -2
- package/dist/src/react.d.ts.map +0 -1
- package/dist/src/shared.d.ts +0 -24
- package/dist/src/shared.d.ts.map +0 -1
- package/dist/src/typescript.d.ts +0 -4
- package/dist/src/typescript.d.ts.map +0 -1
- package/dist/src/unicorn.d.ts +0 -2
- package/dist/src/unicorn.d.ts.map +0 -1
- package/dist/src/vue.d.ts +0 -2
- package/dist/src/vue.d.ts.map +0 -1
- package/index.js +0 -6
- package/src/antfu.js +0 -19
- package/src/basic.js +0 -26
- package/src/ignores.js +0 -10
- package/src/imports.js +0 -55
- package/src/markdown.js +0 -63
- package/src/no-only-tests.js +0 -20
- package/src/package-json.js +0 -78
- package/src/react.js +0 -45
- package/src/shared.js +0 -61
- package/src/typescript.js +0 -128
- package/src/unicorn.js +0 -75
- package/src/vue.js +0 -46
package/README.md
CHANGED
|
@@ -23,36 +23,45 @@ In your `eslint.config.js` file, add the following to extend the basic config:
|
|
|
23
23
|
|
|
24
24
|
```js
|
|
25
25
|
// eslint.config.js
|
|
26
|
-
import {
|
|
26
|
+
import { defineESLintConfig } from '@ocavue/eslint-config'
|
|
27
27
|
|
|
28
|
-
export default
|
|
28
|
+
export default defineESLintConfig()
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
You can pass an optional object to the `defineESLintConfig` function to enable or disable the configs. For example, if you want to enable the React config, you can do the following:
|
|
32
32
|
|
|
33
33
|
```js
|
|
34
34
|
// eslint.config.js
|
|
35
|
-
import {
|
|
35
|
+
import { defineESLintConfig } from '@ocavue/eslint-config'
|
|
36
36
|
|
|
37
|
-
export default
|
|
37
|
+
export default defineESLintConfig({ react: true })
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
The full type definition for the options is as follows:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
export interface ESLintConfigOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Whether to check code blocks in Markdown files.
|
|
46
|
+
*
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
markdown?: boolean
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Whether to enable React configuration.
|
|
53
|
+
*
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
react?: boolean
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Whether to enable Vue configuration.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
vue?: boolean
|
|
64
|
+
}
|
|
56
65
|
```
|
|
57
66
|
|
|
58
67
|
### Add script for package.json
|
|
@@ -86,7 +95,8 @@ If you are using VS Code, you and install [ESLint extension](https://marketplace
|
|
|
86
95
|
}
|
|
87
96
|
```
|
|
88
97
|
|
|
89
|
-
##
|
|
98
|
+
## Alternative solutions
|
|
90
99
|
|
|
91
100
|
- https://github.com/antfu/eslint-config
|
|
92
101
|
- https://github.com/sxzz/eslint-config
|
|
102
|
+
- https://github.com/ntnyq/eslint-config
|
package/dist/antfu.d.ts
ADDED
package/dist/antfu.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import antfuPlugin from 'eslint-plugin-antfu';
|
|
2
|
+
export function antfu() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'antfu',
|
|
6
|
+
plugins: {
|
|
7
|
+
antfu: antfuPlugin,
|
|
8
|
+
},
|
|
9
|
+
rules: {
|
|
10
|
+
'antfu/import-dedupe': 'error',
|
|
11
|
+
'antfu/top-level-function': 'error',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
}
|
package/dist/basic.d.ts
ADDED
package/dist/basic.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { antfu } from './antfu.js';
|
|
2
|
+
import { ignores } from './ignores.js';
|
|
3
|
+
import { imports } from './imports.js';
|
|
4
|
+
import { noOnlyTests } from './no-only-tests.js';
|
|
5
|
+
import { packageJson } from './package-json.js';
|
|
6
|
+
import { prettier } from './prettier.js';
|
|
7
|
+
import { typescript } from './typescript.js';
|
|
8
|
+
import { unicorn } from './unicorn.js';
|
|
9
|
+
export function basic() {
|
|
10
|
+
return [
|
|
11
|
+
...ignores(),
|
|
12
|
+
...typescript(),
|
|
13
|
+
...imports(),
|
|
14
|
+
...packageJson(),
|
|
15
|
+
...unicorn(),
|
|
16
|
+
...antfu(),
|
|
17
|
+
...noOnlyTests(),
|
|
18
|
+
...prettier(),
|
|
19
|
+
];
|
|
20
|
+
}
|
package/dist/ignores.js
ADDED
package/dist/imports.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as importPlugin from 'eslint-plugin-import-x';
|
|
2
|
+
export function imports() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
name: 'import',
|
|
6
|
+
plugins: {
|
|
7
|
+
// @ts-expect-error incorrect type
|
|
8
|
+
import: importPlugin,
|
|
9
|
+
},
|
|
10
|
+
settings: {
|
|
11
|
+
'import-x/resolver': {
|
|
12
|
+
// You will also need to install and configure the TypeScript resolver
|
|
13
|
+
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
|
|
14
|
+
typescript: true,
|
|
15
|
+
node: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
// External modules must be declared in the package.json. Only enforced in CI.
|
|
20
|
+
'import/no-extraneous-dependencies': process.env.CI ? 'error' : 'off',
|
|
21
|
+
'import/first': 'warn',
|
|
22
|
+
'import/no-mutable-exports': 'warn',
|
|
23
|
+
'import/no-useless-path-segments': 'warn',
|
|
24
|
+
'import/newline-after-import': 'warn',
|
|
25
|
+
// Disable `no-duplicates` because of the following bug
|
|
26
|
+
// https://github.com/un-ts/eslint-plugin-import-x/issues/167
|
|
27
|
+
// 'import/no-duplicates': [
|
|
28
|
+
// 'warn',
|
|
29
|
+
// { 'prefer-inline': true },
|
|
30
|
+
// ],
|
|
31
|
+
'import/order': [
|
|
32
|
+
'warn',
|
|
33
|
+
{
|
|
34
|
+
'newlines-between': 'always',
|
|
35
|
+
alphabetize: { order: 'asc' },
|
|
36
|
+
groups: [
|
|
37
|
+
'builtin',
|
|
38
|
+
'external',
|
|
39
|
+
'internal',
|
|
40
|
+
'parent',
|
|
41
|
+
'sibling',
|
|
42
|
+
'index',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
|
|
1
|
+
import { type ESLintConfigOptions } from './options.js';
|
|
2
|
+
import type { Config } from './types.js';
|
|
3
|
+
export * from './basic.js';
|
|
4
|
+
export * from './markdown.js';
|
|
5
|
+
export * from './prettier.js';
|
|
6
|
+
export * from './react.js';
|
|
7
|
+
export * from './typescript.js';
|
|
8
|
+
export * from './vue.js';
|
|
9
|
+
export type { Config, ESLintConfigOptions };
|
|
10
|
+
export declare function defineESLintConfig(options?: ESLintConfigOptions): Config[];
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
import { basic } from './basic.js';
|
|
3
|
+
import { markdown } from './markdown.js';
|
|
4
|
+
import { resolveOptions } from './options.js';
|
|
5
|
+
import { react } from './react.js';
|
|
6
|
+
import { vue } from './vue.js';
|
|
7
|
+
export * from './basic.js';
|
|
8
|
+
export * from './markdown.js';
|
|
9
|
+
export * from './prettier.js';
|
|
10
|
+
export * from './react.js';
|
|
11
|
+
export * from './typescript.js';
|
|
12
|
+
export * from './vue.js';
|
|
13
|
+
export function defineESLintConfig(options) {
|
|
14
|
+
const resolvedOptions = resolveOptions(options);
|
|
15
|
+
const configs = [];
|
|
16
|
+
configs.push(...basic());
|
|
17
|
+
if (resolvedOptions.markdown) {
|
|
18
|
+
configs.push(...markdown());
|
|
19
|
+
}
|
|
20
|
+
if (resolvedOptions.react) {
|
|
21
|
+
configs.push(...react());
|
|
22
|
+
}
|
|
23
|
+
if (resolvedOptions.vue) {
|
|
24
|
+
configs.push(...vue());
|
|
25
|
+
}
|
|
26
|
+
return defineConfig(configs);
|
|
27
|
+
}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import markdownPlugin from '@eslint/markdown';
|
|
2
|
+
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from './shared.js';
|
|
3
|
+
export function markdown() {
|
|
4
|
+
const recommended = markdownPlugin.configs.processor;
|
|
5
|
+
const extra = {
|
|
6
|
+
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
parserOptions: {
|
|
9
|
+
projectService: null,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
// Disable type-aware TypeScript rules, because the code blocks are not
|
|
14
|
+
// part of a compilable `tsconfig.json` project.
|
|
15
|
+
'@typescript-eslint/no-redeclare': 'off',
|
|
16
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
17
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
18
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
19
|
+
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
20
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
21
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
22
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
23
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
24
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
25
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
26
|
+
'@typescript-eslint/no-misused-promises': 'off',
|
|
27
|
+
'@typescript-eslint/await-thenable': 'off',
|
|
28
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
29
|
+
'@typescript-eslint/require-await': 'off',
|
|
30
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
|
|
31
|
+
// Disable some import rules because they are not working well with
|
|
32
|
+
// twoslash ---cut--- imports.
|
|
33
|
+
'import/first': 'off',
|
|
34
|
+
'import/order': 'off',
|
|
35
|
+
'no-alert': 'off',
|
|
36
|
+
'no-console': 'off',
|
|
37
|
+
'no-restricted-imports': 'off',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
return [...recommended, extra];
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ESLintConfigOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to check code blocks in Markdown files.
|
|
4
|
+
*
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
markdown?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to enable React configuration.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
react?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to enable Vue configuration.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
vue?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveOptions({ markdown, react, vue, }?: ESLintConfigOptions): Required<ESLintConfigOptions>;
|
package/dist/options.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import pkgJson from 'eslint-plugin-package-json';
|
|
2
|
+
/**
|
|
3
|
+
* Sort package.json keys
|
|
4
|
+
*/
|
|
5
|
+
export function packageJson() {
|
|
6
|
+
const config = {
|
|
7
|
+
...pkgJson.configs.recommended,
|
|
8
|
+
rules: {
|
|
9
|
+
...pkgJson.configs.recommended.rules,
|
|
10
|
+
'package-json/no-empty-fields': 'off',
|
|
11
|
+
'package-json/valid-package-definition': 'off',
|
|
12
|
+
'package-json/require-description': 'warn',
|
|
13
|
+
'package-json/sort-collections': [
|
|
14
|
+
'warn',
|
|
15
|
+
[
|
|
16
|
+
// 'scripts', // Don't sort scripts
|
|
17
|
+
'devDependencies',
|
|
18
|
+
'dependencies',
|
|
19
|
+
'peerDependencies',
|
|
20
|
+
'config',
|
|
21
|
+
'exports',
|
|
22
|
+
],
|
|
23
|
+
],
|
|
24
|
+
'package-json/order-properties': [
|
|
25
|
+
'warn',
|
|
26
|
+
{
|
|
27
|
+
order: [
|
|
28
|
+
'name',
|
|
29
|
+
'displayName',
|
|
30
|
+
'publisher',
|
|
31
|
+
'type',
|
|
32
|
+
'version',
|
|
33
|
+
'private',
|
|
34
|
+
'packageManager',
|
|
35
|
+
'description',
|
|
36
|
+
'author',
|
|
37
|
+
'license',
|
|
38
|
+
'funding',
|
|
39
|
+
'homepage',
|
|
40
|
+
'repository',
|
|
41
|
+
'bugs',
|
|
42
|
+
'contributes',
|
|
43
|
+
'keywords',
|
|
44
|
+
'categories',
|
|
45
|
+
'sideEffects',
|
|
46
|
+
'main',
|
|
47
|
+
'module',
|
|
48
|
+
'types',
|
|
49
|
+
'exports',
|
|
50
|
+
'typesVersions',
|
|
51
|
+
'bin',
|
|
52
|
+
'icon',
|
|
53
|
+
'files',
|
|
54
|
+
'engines',
|
|
55
|
+
'scripts',
|
|
56
|
+
'dependencies',
|
|
57
|
+
'peerDependencies',
|
|
58
|
+
'peerDependenciesMeta',
|
|
59
|
+
'optionalDependencies',
|
|
60
|
+
'devDependencies',
|
|
61
|
+
'publishConfig',
|
|
62
|
+
'overrides',
|
|
63
|
+
'resolutions',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
return [config];
|
|
70
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
1
2
|
/**
|
|
2
3
|
* Turns off all rules that are unnecessary or might conflict with Prettier.
|
|
3
4
|
*
|
|
4
5
|
* Notice that this config does not run `prettier` as an ESLint rule, so you
|
|
5
6
|
* have to run `pretter` separately for formatting.
|
|
6
7
|
*/
|
|
7
|
-
export function prettier():
|
|
8
|
-
//# sourceMappingURL=prettier.d.ts.map
|
|
8
|
+
export declare function prettier(): Linter.Config[];
|
package/{src → dist}/prettier.js
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import prettierConfig from 'eslint-config-prettier'
|
|
2
|
-
|
|
1
|
+
import prettierConfig from 'eslint-config-prettier';
|
|
3
2
|
/**
|
|
4
3
|
* Turns off all rules that are unnecessary or might conflict with Prettier.
|
|
5
4
|
*
|
|
@@ -7,15 +6,12 @@ import prettierConfig from 'eslint-config-prettier'
|
|
|
7
6
|
* have to run `pretter` separately for formatting.
|
|
8
7
|
*/
|
|
9
8
|
export function prettier() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
return config
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
name: 'prettier',
|
|
12
|
+
rules: {
|
|
13
|
+
...prettierConfig.rules,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
];
|
|
21
17
|
}
|
package/dist/react.d.ts
ADDED
package/dist/react.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import reactPlugin from 'eslint-plugin-react';
|
|
2
|
+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
3
|
+
import { GLOB_TS, GLOB_TSX } from './shared.js';
|
|
4
|
+
export function react() {
|
|
5
|
+
const reactRecommended = reactPlugin.configs.flat?.recommended || {};
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
...reactRecommended,
|
|
9
|
+
name: 'react',
|
|
10
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
11
|
+
settings: {
|
|
12
|
+
react: {
|
|
13
|
+
version: 'detect',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
...reactRecommended.rules,
|
|
18
|
+
'react/prop-types': 'off',
|
|
19
|
+
'react/react-in-jsx-scope': 'off',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'react-hooks',
|
|
24
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
25
|
+
plugins: {
|
|
26
|
+
'react-hooks': reactHooksPlugin,
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
30
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
2
|
+
export declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
3
|
+
export declare const GLOB_JS = "**/*.?([cm])js";
|
|
4
|
+
export declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
5
|
+
export declare const GLOB_TS = "**/*.?([cm])ts";
|
|
6
|
+
export declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
7
|
+
export declare const GLOB_TEST = "**/*.(spec|test).?([cm])[jt]s?(x)";
|
|
8
|
+
export declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
9
|
+
export declare const GLOB_CSS = "**/*.css";
|
|
10
|
+
export declare const GLOB_LESS = "**/*.less";
|
|
11
|
+
export declare const GLOB_SCSS = "**/*.scss";
|
|
12
|
+
export declare const GLOB_JSON = "**/*.json";
|
|
13
|
+
export declare const GLOB_JSON5 = "**/*.json5";
|
|
14
|
+
export declare const GLOB_JSONC = "**/*.jsonc";
|
|
15
|
+
export declare const GLOB_MARKDOWN = "**/*.md";
|
|
16
|
+
export declare const GLOB_VUE = "**/*.vue";
|
|
17
|
+
export declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
18
|
+
export declare const GLOB_HTML = "**/*.htm?(l)";
|
|
19
|
+
export declare const GLOB_ALL_SRC: readonly ["**/*.?([cm])[jt]s?(x)", "**/*.{c,le,sc}ss", "**/*.json", "**/*.json5", "**/*.md", "**/*.vue", "**/*.y?(a)ml", "**/*.htm?(l)"];
|
|
20
|
+
export declare const GLOB_NODE_MODULES: "**/node_modules";
|
|
21
|
+
export declare const GLOB_LOCKFILE: readonly ["**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml"];
|
|
22
|
+
export declare const GLOB_EXCLUDE: readonly ["**/node_modules", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/fixtures", "**/.changeset", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__", "**/.tsup"];
|
|
23
|
+
export declare const EXTENSIONS: string[];
|
package/dist/shared.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const GLOB_SRC_EXT = '?([cm])[jt]s?(x)';
|
|
2
|
+
export const GLOB_SRC = '**/*.?([cm])[jt]s?(x)';
|
|
3
|
+
export const GLOB_JS = '**/*.?([cm])js';
|
|
4
|
+
export const GLOB_JSX = '**/*.?([cm])jsx';
|
|
5
|
+
export const GLOB_TS = '**/*.?([cm])ts';
|
|
6
|
+
export const GLOB_TSX = '**/*.?([cm])tsx';
|
|
7
|
+
export const GLOB_TEST = '**/*.(spec|test).?([cm])[jt]s?(x)';
|
|
8
|
+
export const GLOB_STYLE = '**/*.{c,le,sc}ss';
|
|
9
|
+
export const GLOB_CSS = '**/*.css';
|
|
10
|
+
export const GLOB_LESS = '**/*.less';
|
|
11
|
+
export const GLOB_SCSS = '**/*.scss';
|
|
12
|
+
export const GLOB_JSON = '**/*.json';
|
|
13
|
+
export const GLOB_JSON5 = '**/*.json5';
|
|
14
|
+
export const GLOB_JSONC = '**/*.jsonc';
|
|
15
|
+
export const GLOB_MARKDOWN = '**/*.md';
|
|
16
|
+
export const GLOB_VUE = '**/*.vue';
|
|
17
|
+
export const GLOB_YAML = '**/*.y?(a)ml';
|
|
18
|
+
export const GLOB_HTML = '**/*.htm?(l)';
|
|
19
|
+
export const GLOB_ALL_SRC = [
|
|
20
|
+
GLOB_SRC,
|
|
21
|
+
GLOB_STYLE,
|
|
22
|
+
GLOB_JSON,
|
|
23
|
+
GLOB_JSON5,
|
|
24
|
+
GLOB_MARKDOWN,
|
|
25
|
+
GLOB_VUE,
|
|
26
|
+
GLOB_YAML,
|
|
27
|
+
GLOB_HTML,
|
|
28
|
+
];
|
|
29
|
+
export const GLOB_NODE_MODULES = '**/node_modules';
|
|
30
|
+
export const GLOB_LOCKFILE = [
|
|
31
|
+
'**/package-lock.json',
|
|
32
|
+
'**/yarn.lock',
|
|
33
|
+
'**/pnpm-lock.yaml',
|
|
34
|
+
];
|
|
35
|
+
export const GLOB_EXCLUDE = [
|
|
36
|
+
GLOB_NODE_MODULES,
|
|
37
|
+
...GLOB_LOCKFILE,
|
|
38
|
+
'**/fixtures',
|
|
39
|
+
'**/.changeset',
|
|
40
|
+
'**/CHANGELOG*.md',
|
|
41
|
+
'**/*.min.*',
|
|
42
|
+
'**/LICENSE*',
|
|
43
|
+
'**/__snapshots__',
|
|
44
|
+
'**/.tsup',
|
|
45
|
+
];
|
|
46
|
+
export const EXTENSIONS = ['ts', 'js']
|
|
47
|
+
.flatMap((ext) => [ext, ext + 'x'])
|
|
48
|
+
.flatMap((ext) => [ext, 'm' + ext, 'c' + ext])
|
|
49
|
+
.flatMap((ext) => [ext, 'd.' + ext]);
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|