@fenge/eslint-config 0.1.0-beta.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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/config/gitignore.d.ts +4 -0
- package/dist/config/gitignore.d.ts.map +1 -0
- package/dist/config/gitignore.js +19 -0
- package/dist/config/ignore.d.ts +14 -0
- package/dist/config/ignore.d.ts.map +1 -0
- package/dist/config/ignore.js +22 -0
- package/dist/config/javascript.d.ts +419 -0
- package/dist/config/javascript.d.ts.map +1 -0
- package/dist/config/javascript.js +474 -0
- package/dist/config/packagejson.d.ts +29 -0
- package/dist/config/packagejson.d.ts.map +1 -0
- package/dist/config/packagejson.js +34 -0
- package/dist/config/typescript.d.ts +533 -0
- package/dist/config/typescript.d.ts.map +1 -0
- package/dist/config/typescript.js +238 -0
- package/dist/eslint.config.d.ts +25 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/eslint.config.js +68 -0
- package/package.json +59 -0
- package/src/config/gitignore.ts +24 -0
- package/src/config/ignore.ts +21 -0
- package/src/config/javascript.spec.ts +31 -0
- package/src/config/javascript.ts +485 -0
- package/src/config/packagejson.ts +34 -0
- package/src/config/typescript.spec.ts +84 -0
- package/src/config/typescript.ts +261 -0
- package/src/eslint.config.spec.ts +32 -0
- package/src/eslint.config.ts +100 -0
- package/src/typing.d.ts +8 -0
- package/test/no-duplicated.spec.ts +61 -0
- package/test/prettier.spec.ts +42 -0
- package/tsconfig.build.json +5 -0
- package/tsconfig.json +3 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @fenge/eslint-config
|
|
2
|
+
|
|
3
|
+
## 0.1.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b5b70e3: feat(eslint-config): migrate from `@git-validator/eslint-config` to `@fenge/eslint-config`
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [0beda11]
|
|
12
|
+
- Updated dependencies [615a726]
|
|
13
|
+
- @fenge/eslint-plugin@0.1.0-beta.0
|
|
14
|
+
- @fenge/eslint-plugin-ts@0.1.0-beta.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 曾明健
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @fenge/eslint-config
|
|
2
|
+
|
|
3
|
+
[](https://github.com/zanminkian/fenge/blob/main/LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@fenge/eslint-config)
|
|
5
|
+
[](https://www.npmjs.com/package/@fenge/eslint-config)
|
|
6
|
+
[](https://packagephobia.com/result?p=@fenge/eslint-config)
|
|
7
|
+
[](https://makeapullrequest.com)
|
|
8
|
+
|
|
9
|
+
A strict eslint config for linting `js` / `ts` / `package.json` files. Based on [standard.js](https://github.com/standard/standard) without any stylistic opinions.
|
|
10
|
+
|
|
11
|
+
## Feature
|
|
12
|
+
|
|
13
|
+
- Lint `js` / `mjs` / `cjs` / `jsx` / `ts` / `mts` / `cts` / `tsx` / `package.json` files only.
|
|
14
|
+
- One-line of config.
|
|
15
|
+
- Type safe. TypeScript friendly.
|
|
16
|
+
- Pure JavaScript project friendly.
|
|
17
|
+
- Respect `.gitignore`.
|
|
18
|
+
- Based on [standard.js](https://github.com/standard/standard), introduced more stricter rules.
|
|
19
|
+
- Have no stylistic opinions. Prettier friendly.
|
|
20
|
+
- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
|
|
21
|
+
- Strict, but progressive.
|
|
22
|
+
- Modern. ESM first.
|
|
23
|
+
- React friendly.
|
|
24
|
+
- NestJS friendly.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Install it in the root of js / ts project.
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install -D eslint @fenge/eslint-config
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Config `eslint.config.js` (for ESM).
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import config from "@fenge/eslint-config";
|
|
38
|
+
|
|
39
|
+
export default config;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If you are in CommonJS, config `eslint.config.js` bellow:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
module.exports = import("@fenge/eslint-config");
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Config `package.json`
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"scripts": {
|
|
53
|
+
"lint": "eslint .",
|
|
54
|
+
"lint:fix": "eslint . --fix"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> Note: TypeScript project is required a `tsconfig.json` file in the root.
|
|
60
|
+
|
|
61
|
+
## Advanced Usage
|
|
62
|
+
|
|
63
|
+
### Config Builder
|
|
64
|
+
|
|
65
|
+
You can use `Builder` class to customize for selecting or omitting some rules.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { Builder } from "@fenge/eslint-config";
|
|
69
|
+
|
|
70
|
+
export default new Builder()
|
|
71
|
+
.enablePackagejson({
|
|
72
|
+
pick: ["packagejson/top-types"], // only these rules will work for package.json files
|
|
73
|
+
})
|
|
74
|
+
.enableJavascript({
|
|
75
|
+
omit: ["no-var"], // these rules will not work for js files
|
|
76
|
+
})
|
|
77
|
+
.enableTypescript({
|
|
78
|
+
project: "tsconfig.json", // tsconfig.json path
|
|
79
|
+
extend: {
|
|
80
|
+
// apply additional rules for ts files
|
|
81
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
82
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
83
|
+
"error",
|
|
84
|
+
{ assertionStyle: "never" },
|
|
85
|
+
],
|
|
86
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
87
|
+
},
|
|
88
|
+
})
|
|
89
|
+
.toConfig();
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../src/config/gitignore.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS;;GAqBxB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import childProcess from "node:child_process";
|
|
2
|
+
export function gitignore() {
|
|
3
|
+
let stdout = "";
|
|
4
|
+
try {
|
|
5
|
+
stdout = childProcess.execSync("git ls-files --others --ignored --exclude-standard --directory", { encoding: "utf8" });
|
|
6
|
+
}
|
|
7
|
+
catch (e) {
|
|
8
|
+
console.warn("Warn: Running `git ls-files` fail. We recommend to run `git init` to setup the project first.", e);
|
|
9
|
+
}
|
|
10
|
+
// https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
// TODO waiting for eslint 9
|
|
14
|
+
// name: 'fenge/ignore',
|
|
15
|
+
ignores: stdout.split("\n").filter(Boolean),
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2l0aWdub3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZy9naXRpZ25vcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxZQUFZLE1BQU0sb0JBQW9CLENBQUM7QUFFOUMsTUFBTSxVQUFVLFNBQVM7SUFDdkIsSUFBSSxNQUFNLEdBQUcsRUFBRSxDQUFDO0lBQ2hCLElBQUksQ0FBQztRQUNILE1BQU0sR0FBRyxZQUFZLENBQUMsUUFBUSxDQUM1QixnRUFBZ0UsRUFDaEUsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLENBQ3JCLENBQUM7SUFDSixDQUFDO0lBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQztRQUNYLE9BQU8sQ0FBQyxJQUFJLENBQ1YsK0ZBQStGLEVBQy9GLENBQUMsQ0FDRixDQUFDO0lBQ0osQ0FBQztJQUNELGdHQUFnRztJQUNoRyxPQUFPO1FBQ0w7WUFDRSw0QkFBNEI7WUFDNUIsd0JBQXdCO1lBQ3hCLE9BQU8sRUFBRSxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUM7U0FDNUM7S0FDTyxDQUFDO0FBQ2IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjaGlsZFByb2Nlc3MgZnJvbSBcIm5vZGU6Y2hpbGRfcHJvY2Vzc1wiO1xuXG5leHBvcnQgZnVuY3Rpb24gZ2l0aWdub3JlKCkge1xuICBsZXQgc3Rkb3V0ID0gXCJcIjtcbiAgdHJ5IHtcbiAgICBzdGRvdXQgPSBjaGlsZFByb2Nlc3MuZXhlY1N5bmMoXG4gICAgICBcImdpdCBscy1maWxlcyAtLW90aGVycyAtLWlnbm9yZWQgLS1leGNsdWRlLXN0YW5kYXJkIC0tZGlyZWN0b3J5XCIsXG4gICAgICB7IGVuY29kaW5nOiBcInV0ZjhcIiB9LFxuICAgICk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICBjb25zb2xlLndhcm4oXG4gICAgICBcIldhcm46IFJ1bm5pbmcgYGdpdCBscy1maWxlc2AgZmFpbC4gV2UgcmVjb21tZW5kIHRvIHJ1biBgZ2l0IGluaXRgIHRvIHNldHVwIHRoZSBwcm9qZWN0IGZpcnN0LlwiLFxuICAgICAgZSxcbiAgICApO1xuICB9XG4gIC8vIGh0dHBzOi8vZXNsaW50Lm9yZy9kb2NzL2xhdGVzdC91c2UvY29uZmlndXJlL2NvbmZpZ3VyYXRpb24tZmlsZXMjc3BlY2lmeWluZy1maWxlcy1hbmQtaWdub3Jlc1xuICByZXR1cm4gW1xuICAgIHtcbiAgICAgIC8vIFRPRE8gd2FpdGluZyBmb3IgZXNsaW50IDlcbiAgICAgIC8vIG5hbWU6ICdmZW5nZS9pZ25vcmUnLFxuICAgICAgaWdub3Jlczogc3Rkb3V0LnNwbGl0KFwiXFxuXCIpLmZpbHRlcihCb29sZWFuKSxcbiAgICB9LFxuICBdIGFzIGNvbnN0O1xufVxuIl19
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This config is for suppressing error when linting a directory which does not contain supported files
|
|
3
|
+
*/
|
|
4
|
+
export declare function ignore(): readonly [{
|
|
5
|
+
readonly name: "fenge/ignore";
|
|
6
|
+
readonly files: readonly ["**"];
|
|
7
|
+
readonly ignores: readonly ["**/*.{js,cjs,mjs,jsx}", "**/*.{ts,cts,mts,tsx}", "**/package.json"];
|
|
8
|
+
readonly processor: {
|
|
9
|
+
readonly preprocess: (_text: string, _filename: string) => string[];
|
|
10
|
+
readonly postprocess: (_messages: unknown[][]) => never[];
|
|
11
|
+
};
|
|
12
|
+
readonly rules: {};
|
|
13
|
+
}];
|
|
14
|
+
//# sourceMappingURL=ignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/config/ignore.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,MAAM;;;;;qCAWM,MAAM,aAAa,MAAM;0CACpB,OAAO,EAAE,EAAE;;;GAK3C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This config is for suppressing error when linting a directory which does not contain supported files
|
|
3
|
+
*/
|
|
4
|
+
export function ignore() {
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
name: "fenge/ignore",
|
|
8
|
+
files: ["**"], // I've tried all. Only '**' works.
|
|
9
|
+
ignores: [
|
|
10
|
+
"**/*.{js,cjs,mjs,jsx}",
|
|
11
|
+
"**/*.{ts,cts,mts,tsx}",
|
|
12
|
+
"**/package.json",
|
|
13
|
+
],
|
|
14
|
+
processor: {
|
|
15
|
+
preprocess: (_text, _filename) => [""],
|
|
16
|
+
postprocess: (_messages) => [], // Returning empty array to ignore all errors
|
|
17
|
+
},
|
|
18
|
+
rules: {},
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWdub3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZy9pZ25vcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxNQUFNLFVBQVUsTUFBTTtJQUNwQixPQUFPO1FBQ0w7WUFDRSxJQUFJLEVBQUUsY0FBYztZQUNwQixLQUFLLEVBQUUsQ0FBQyxJQUFJLENBQUMsRUFBRSxtQ0FBbUM7WUFDbEQsT0FBTyxFQUFFO2dCQUNQLHVCQUF1QjtnQkFDdkIsdUJBQXVCO2dCQUN2QixpQkFBaUI7YUFDbEI7WUFDRCxTQUFTLEVBQUU7Z0JBQ1QsVUFBVSxFQUFFLENBQUMsS0FBYSxFQUFFLFNBQWlCLEVBQUUsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO2dCQUN0RCxXQUFXLEVBQUUsQ0FBQyxTQUFzQixFQUFFLEVBQUUsQ0FBQyxFQUFFLEVBQUUsNkNBQTZDO2FBQzNGO1lBQ0QsS0FBSyxFQUFFLEVBQUU7U0FDVjtLQUNPLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBUaGlzIGNvbmZpZyBpcyBmb3Igc3VwcHJlc3NpbmcgZXJyb3Igd2hlbiBsaW50aW5nIGEgZGlyZWN0b3J5IHdoaWNoIGRvZXMgbm90IGNvbnRhaW4gc3VwcG9ydGVkIGZpbGVzXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBpZ25vcmUoKSB7XG4gIHJldHVybiBbXG4gICAge1xuICAgICAgbmFtZTogXCJmZW5nZS9pZ25vcmVcIixcbiAgICAgIGZpbGVzOiBbXCIqKlwiXSwgLy8gSSd2ZSB0cmllZCBhbGwuIE9ubHkgJyoqJyB3b3Jrcy5cbiAgICAgIGlnbm9yZXM6IFtcbiAgICAgICAgXCIqKi8qLntqcyxjanMsbWpzLGpzeH1cIixcbiAgICAgICAgXCIqKi8qLnt0cyxjdHMsbXRzLHRzeH1cIixcbiAgICAgICAgXCIqKi9wYWNrYWdlLmpzb25cIixcbiAgICAgIF0sXG4gICAgICBwcm9jZXNzb3I6IHtcbiAgICAgICAgcHJlcHJvY2VzczogKF90ZXh0OiBzdHJpbmcsIF9maWxlbmFtZTogc3RyaW5nKSA9PiBbXCJcIl0sXG4gICAgICAgIHBvc3Rwcm9jZXNzOiAoX21lc3NhZ2VzOiB1bmtub3duW11bXSkgPT4gW10sIC8vIFJldHVybmluZyBlbXB0eSBhcnJheSB0byBpZ25vcmUgYWxsIGVycm9yc1xuICAgICAgfSxcbiAgICAgIHJ1bGVzOiB7fSxcbiAgICB9LFxuICBdIGFzIGNvbnN0O1xufVxuIl19
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import * as fengePlugin from "@fenge/eslint-plugin";
|
|
2
|
+
import * as esmPlugin from "eslint-plugin-esm";
|
|
3
|
+
import reactPlugin from "eslint-plugin-react";
|
|
4
|
+
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
5
|
+
export declare function javascript(): readonly [{
|
|
6
|
+
readonly name: "fenge/javascript";
|
|
7
|
+
readonly files: readonly ["**/*.{js,cjs,mjs,jsx}"];
|
|
8
|
+
readonly languageOptions: {
|
|
9
|
+
readonly ecmaVersion: "latest";
|
|
10
|
+
readonly sourceType: "module";
|
|
11
|
+
readonly parserOptions: {
|
|
12
|
+
readonly ecmaVersion: "latest";
|
|
13
|
+
readonly sourceType: "module";
|
|
14
|
+
readonly ecmaFeatures: {
|
|
15
|
+
readonly jsx: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly globals: {
|
|
19
|
+
readonly [x: string]: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
readonly linterOptions: {
|
|
23
|
+
readonly reportUnusedDisableDirectives: true;
|
|
24
|
+
};
|
|
25
|
+
readonly plugins: {
|
|
26
|
+
readonly fp: unknown;
|
|
27
|
+
readonly n: import("eslint").ESLint.Plugin & {
|
|
28
|
+
configs: {
|
|
29
|
+
'recommended-module': import("eslint").ESLint.ConfigData;
|
|
30
|
+
'recommended-script': import("eslint").ESLint.ConfigData;
|
|
31
|
+
recommended: import("eslint").ESLint.ConfigData;
|
|
32
|
+
'flat/recommended-module': import("eslint").Linter.FlatConfig;
|
|
33
|
+
'flat/recommended-script': import("eslint").Linter.FlatConfig;
|
|
34
|
+
'flat/recommended': import("eslint").Linter.FlatConfig;
|
|
35
|
+
'flat/mixed-esm-and-cjs': import("eslint").Linter.FlatConfig[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly import: unknown;
|
|
39
|
+
readonly promise: unknown;
|
|
40
|
+
readonly react: typeof reactPlugin;
|
|
41
|
+
readonly "react-hooks": unknown;
|
|
42
|
+
readonly sonarjs: typeof sonarjsPlugin;
|
|
43
|
+
readonly unicorn: import("eslint").ESLint.Plugin & {
|
|
44
|
+
configs: {
|
|
45
|
+
recommended: import("eslint").Linter.Config;
|
|
46
|
+
all: import("eslint").Linter.Config;
|
|
47
|
+
"flat/all": import("eslint").Linter.FlatConfig;
|
|
48
|
+
"flat/recommended": import("eslint").Linter.FlatConfig;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly "es-x": unknown;
|
|
52
|
+
readonly esm: typeof esmPlugin;
|
|
53
|
+
readonly "simple-import-sort": import("eslint").ESLint.Plugin;
|
|
54
|
+
readonly "@fenge": typeof fengePlugin;
|
|
55
|
+
readonly "@typescript-eslint": {
|
|
56
|
+
configs: Record<string, import("@typescript-eslint/utils/ts-eslint").ClassicConfig.Config>;
|
|
57
|
+
meta: import("@typescript-eslint/utils/ts-eslint").FlatConfig.PluginMeta;
|
|
58
|
+
rules: import("@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules").TypeScriptESLintRules;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly rules: {
|
|
62
|
+
readonly "arrow-body-style": readonly ["error", "as-needed"];
|
|
63
|
+
readonly "import/newline-after-import": readonly ["error", {
|
|
64
|
+
readonly count: 1;
|
|
65
|
+
}];
|
|
66
|
+
readonly "simple-import-sort/exports": "error";
|
|
67
|
+
readonly "unicorn/prefer-node-protocol": "error";
|
|
68
|
+
readonly "unicorn/escape-case": "error";
|
|
69
|
+
readonly "default-param-last": "error";
|
|
70
|
+
readonly "func-name-matching": "error";
|
|
71
|
+
readonly "getter-return": "error";
|
|
72
|
+
readonly "init-declarations": "error";
|
|
73
|
+
readonly "max-params": readonly ["error", {
|
|
74
|
+
readonly max: 4;
|
|
75
|
+
}];
|
|
76
|
+
readonly "no-duplicate-imports": "error";
|
|
77
|
+
readonly "no-empty-static-block": "error";
|
|
78
|
+
readonly "no-empty-function": "error";
|
|
79
|
+
readonly "no-implicit-coercion": readonly ["error", {
|
|
80
|
+
readonly disallowTemplateShorthand: true;
|
|
81
|
+
readonly allow: readonly ["!!"];
|
|
82
|
+
}];
|
|
83
|
+
readonly "no-invalid-this": "error";
|
|
84
|
+
readonly "no-multi-assign": "error";
|
|
85
|
+
readonly "no-param-reassign": "error";
|
|
86
|
+
readonly "no-plusplus": "error";
|
|
87
|
+
readonly "no-setter-return": "error";
|
|
88
|
+
readonly "no-shadow": readonly ["error", {
|
|
89
|
+
readonly ignoreOnInitialization: true;
|
|
90
|
+
}];
|
|
91
|
+
readonly "no-unused-private-class-members": "error";
|
|
92
|
+
readonly "prefer-arrow-callback": "error";
|
|
93
|
+
readonly "prefer-exponentiation-operator": "error";
|
|
94
|
+
readonly "prefer-object-has-own": "error";
|
|
95
|
+
readonly "prefer-template": "error";
|
|
96
|
+
readonly "es-x/no-accessor-properties": "error";
|
|
97
|
+
readonly "es-x/no-async-iteration": "error";
|
|
98
|
+
readonly "es-x/no-generators": "error";
|
|
99
|
+
readonly "es-x/no-legacy-object-prototype-accessor-methods": "error";
|
|
100
|
+
readonly "esm/nearest-relative-path": "error";
|
|
101
|
+
readonly "esm/no-directory-imports": "error";
|
|
102
|
+
readonly "esm/no-dynamic-imports": "error";
|
|
103
|
+
readonly "esm/no-git-ignored-imports": "error";
|
|
104
|
+
readonly "esm/no-phantom-dep-imports": "error";
|
|
105
|
+
readonly "esm/no-relative-parent-imports": "error";
|
|
106
|
+
readonly "esm/no-rename-exports": "error";
|
|
107
|
+
readonly "esm/no-rename-imports": "error";
|
|
108
|
+
readonly "esm/no-side-effect-imports": "error";
|
|
109
|
+
readonly "esm/no-ts-file-imports": "error";
|
|
110
|
+
readonly "fp/no-arguments": "error";
|
|
111
|
+
readonly "fp/no-delete": "error";
|
|
112
|
+
readonly "import/extensions": readonly ["error", "always", {
|
|
113
|
+
readonly ignorePackages: true;
|
|
114
|
+
}];
|
|
115
|
+
readonly "import/no-commonjs": readonly ["error", {
|
|
116
|
+
readonly allowRequire: false;
|
|
117
|
+
readonly allowConditionalRequire: false;
|
|
118
|
+
readonly allowPrimitiveModules: false;
|
|
119
|
+
}];
|
|
120
|
+
/**
|
|
121
|
+
* 1. The ESM specification didn’t say anything about interoperability with CommonJS. See: https://blog.andrewbran.ch/default-exports-in-commonjs-libraries/
|
|
122
|
+
* 2. Reexporting like `export * from 'foo'` will be difficult.
|
|
123
|
+
*/
|
|
124
|
+
readonly "import/no-default-export": "error";
|
|
125
|
+
readonly "import/no-dynamic-require": "error";
|
|
126
|
+
readonly "import/no-mutable-exports": "error";
|
|
127
|
+
readonly "import/no-relative-packages": "error";
|
|
128
|
+
readonly "import/no-self-import": "error";
|
|
129
|
+
readonly "n/prefer-global/buffer": readonly ["error", "never"];
|
|
130
|
+
readonly "n/prefer-global/console": "error";
|
|
131
|
+
readonly "n/prefer-global/process": readonly ["error", "never"];
|
|
132
|
+
readonly "n/prefer-global/text-decoder": "error";
|
|
133
|
+
readonly "n/prefer-global/text-encoder": "error";
|
|
134
|
+
readonly "n/prefer-global/url": "error";
|
|
135
|
+
readonly "n/prefer-global/url-search-params": "error";
|
|
136
|
+
readonly "react/jsx-key": "error";
|
|
137
|
+
readonly "react/jsx-no-duplicate-props": "error";
|
|
138
|
+
readonly "react/jsx-no-undef": "error";
|
|
139
|
+
readonly "react-hooks/exhaustive-deps": "error";
|
|
140
|
+
readonly "react-hooks/rules-of-hooks": "error";
|
|
141
|
+
readonly "sonarjs/no-collapsible-if": "error";
|
|
142
|
+
readonly "sonarjs/no-all-duplicated-branches": "error";
|
|
143
|
+
readonly "sonarjs/no-identical-conditions": "error";
|
|
144
|
+
readonly "sonarjs/no-identical-expressions": "error";
|
|
145
|
+
readonly "sonarjs/no-ignored-return": "error";
|
|
146
|
+
readonly "sonarjs/no-inverted-boolean-check": "error";
|
|
147
|
+
readonly "sonarjs/no-nested-switch": "error";
|
|
148
|
+
readonly "sonarjs/no-useless-catch": "error";
|
|
149
|
+
readonly "sonarjs/prefer-immediate-return": "error";
|
|
150
|
+
readonly "unicorn/consistent-destructuring": "error";
|
|
151
|
+
readonly "unicorn/consistent-empty-array-spread": "error";
|
|
152
|
+
readonly "unicorn/error-message": "error";
|
|
153
|
+
readonly "unicorn/explicit-length-check": "error";
|
|
154
|
+
readonly "unicorn/filename-case": readonly ["error", {
|
|
155
|
+
readonly cases: {
|
|
156
|
+
readonly kebabCase: true;
|
|
157
|
+
readonly pascalCase: true;
|
|
158
|
+
};
|
|
159
|
+
}];
|
|
160
|
+
readonly "unicorn/import-style": readonly ["error", {
|
|
161
|
+
readonly styles: {
|
|
162
|
+
readonly child_process: {
|
|
163
|
+
readonly default: true;
|
|
164
|
+
};
|
|
165
|
+
readonly fs: {
|
|
166
|
+
readonly default: true;
|
|
167
|
+
};
|
|
168
|
+
readonly "fs/promises": {
|
|
169
|
+
readonly default: true;
|
|
170
|
+
};
|
|
171
|
+
readonly process: {
|
|
172
|
+
readonly default: true;
|
|
173
|
+
};
|
|
174
|
+
readonly "util/types": {
|
|
175
|
+
readonly named: true;
|
|
176
|
+
};
|
|
177
|
+
readonly "node:child_process": {
|
|
178
|
+
readonly default: true;
|
|
179
|
+
};
|
|
180
|
+
readonly "node:fs": {
|
|
181
|
+
readonly default: true;
|
|
182
|
+
};
|
|
183
|
+
readonly "node:fs/promises": {
|
|
184
|
+
readonly default: true;
|
|
185
|
+
};
|
|
186
|
+
readonly "node:process": {
|
|
187
|
+
readonly default: true;
|
|
188
|
+
};
|
|
189
|
+
readonly "node:util/types": {
|
|
190
|
+
readonly named: true;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}];
|
|
194
|
+
readonly "unicorn/new-for-builtins": "error";
|
|
195
|
+
readonly "unicorn/no-abusive-eslint-disable": "error";
|
|
196
|
+
readonly "unicorn/no-array-callback-reference": "error";
|
|
197
|
+
readonly "unicorn/no-array-method-this-argument": "error";
|
|
198
|
+
readonly "unicorn/no-for-loop": "error";
|
|
199
|
+
readonly "unicorn/no-instanceof-array": "error";
|
|
200
|
+
readonly "unicorn/no-new-array": "error";
|
|
201
|
+
readonly "unicorn/no-new-buffer": "error";
|
|
202
|
+
readonly "unicorn/no-typeof-undefined": "error";
|
|
203
|
+
readonly "unicorn/no-unreadable-iife": "error";
|
|
204
|
+
readonly "unicorn/no-useless-spread": "error";
|
|
205
|
+
readonly "unicorn/prefer-array-flat-map": "error";
|
|
206
|
+
readonly "unicorn/prefer-global-this": "error";
|
|
207
|
+
readonly "unicorn/prefer-includes": "error";
|
|
208
|
+
readonly "unicorn/prefer-module": "error";
|
|
209
|
+
readonly "unicorn/prefer-number-properties": "error";
|
|
210
|
+
readonly "unicorn/prefer-string-slice": "error";
|
|
211
|
+
readonly "unicorn/prefer-ternary": "error";
|
|
212
|
+
readonly "unicorn/throw-new-error": "error";
|
|
213
|
+
readonly "@fenge/call-arguments-length": "error";
|
|
214
|
+
readonly "@fenge/no-instanceof-builtin": "error";
|
|
215
|
+
readonly "@fenge/no-restricted-loops": "error";
|
|
216
|
+
readonly "@fenge/no-unnecessary-template-string": "error";
|
|
217
|
+
readonly "@typescript-eslint/ban-ts-comment": readonly ["error", {
|
|
218
|
+
readonly "ts-expect-error": true;
|
|
219
|
+
readonly "ts-ignore": true;
|
|
220
|
+
readonly "ts-nocheck": true;
|
|
221
|
+
}];
|
|
222
|
+
readonly "@typescript-eslint/no-useless-empty-export": "error";
|
|
223
|
+
readonly 'no-var': "error";
|
|
224
|
+
readonly 'object-shorthand': readonly ["error", "properties"];
|
|
225
|
+
readonly 'accessor-pairs': readonly ["error", {
|
|
226
|
+
readonly setWithoutGet: true;
|
|
227
|
+
readonly enforceForClassMembers: true;
|
|
228
|
+
}];
|
|
229
|
+
readonly 'array-callback-return': readonly ["error", {
|
|
230
|
+
readonly allowImplicit: false;
|
|
231
|
+
readonly checkForEach: false;
|
|
232
|
+
}];
|
|
233
|
+
readonly camelcase: readonly ["error", {
|
|
234
|
+
readonly allow: readonly ["^UNSAFE_"];
|
|
235
|
+
readonly properties: "never";
|
|
236
|
+
readonly ignoreGlobals: true;
|
|
237
|
+
}];
|
|
238
|
+
readonly 'constructor-super': "error";
|
|
239
|
+
readonly 'default-case-last': "error";
|
|
240
|
+
readonly eqeqeq: readonly ["error", "always", {
|
|
241
|
+
readonly null: "ignore";
|
|
242
|
+
}];
|
|
243
|
+
readonly 'lines-between-class-members': readonly ["error", "always", {
|
|
244
|
+
readonly exceptAfterSingleLine: true;
|
|
245
|
+
}];
|
|
246
|
+
readonly 'new-cap': readonly ["error", {
|
|
247
|
+
readonly newIsCap: true;
|
|
248
|
+
readonly capIsNew: false;
|
|
249
|
+
readonly properties: true;
|
|
250
|
+
}];
|
|
251
|
+
readonly 'no-array-constructor': "error";
|
|
252
|
+
readonly 'no-async-promise-executor': "error";
|
|
253
|
+
readonly 'no-caller': "error";
|
|
254
|
+
readonly 'no-case-declarations': "error";
|
|
255
|
+
readonly 'no-class-assign': "error";
|
|
256
|
+
readonly 'no-compare-neg-zero': "error";
|
|
257
|
+
readonly 'no-cond-assign': "error";
|
|
258
|
+
readonly 'no-const-assign': "error";
|
|
259
|
+
readonly 'no-constant-condition': readonly ["error", {
|
|
260
|
+
readonly checkLoops: false;
|
|
261
|
+
}];
|
|
262
|
+
readonly 'no-control-regex': "error";
|
|
263
|
+
readonly 'no-debugger': "error";
|
|
264
|
+
readonly 'no-delete-var': "error";
|
|
265
|
+
readonly 'no-dupe-args': "error";
|
|
266
|
+
readonly 'no-dupe-class-members': "error";
|
|
267
|
+
readonly 'no-dupe-keys': "error";
|
|
268
|
+
readonly 'no-duplicate-case': "error";
|
|
269
|
+
readonly 'no-useless-backreference': "error";
|
|
270
|
+
readonly 'no-empty': readonly ["error", {
|
|
271
|
+
readonly allowEmptyCatch: true;
|
|
272
|
+
}];
|
|
273
|
+
readonly 'no-empty-character-class': "error";
|
|
274
|
+
readonly 'no-empty-pattern': "error";
|
|
275
|
+
readonly 'no-eval': "error";
|
|
276
|
+
readonly 'no-ex-assign': "error";
|
|
277
|
+
readonly 'no-extend-native': "error";
|
|
278
|
+
readonly 'no-extra-bind': "error";
|
|
279
|
+
readonly 'no-extra-boolean-cast': "error";
|
|
280
|
+
readonly 'no-fallthrough': "error";
|
|
281
|
+
readonly 'no-func-assign': "error";
|
|
282
|
+
readonly 'no-global-assign': "error";
|
|
283
|
+
readonly 'no-implied-eval': "error";
|
|
284
|
+
readonly 'no-import-assign': "error";
|
|
285
|
+
readonly 'no-invalid-regexp': "error";
|
|
286
|
+
readonly 'no-irregular-whitespace': "error";
|
|
287
|
+
readonly 'no-iterator': "error";
|
|
288
|
+
readonly 'no-labels': readonly ["error", {
|
|
289
|
+
readonly allowLoop: false;
|
|
290
|
+
readonly allowSwitch: false;
|
|
291
|
+
}];
|
|
292
|
+
readonly 'no-lone-blocks': "error";
|
|
293
|
+
readonly 'no-loss-of-precision': "error";
|
|
294
|
+
readonly 'no-misleading-character-class': "error";
|
|
295
|
+
readonly 'no-prototype-builtins': "error";
|
|
296
|
+
readonly 'no-useless-catch': "error";
|
|
297
|
+
readonly 'no-multi-str': "error";
|
|
298
|
+
readonly 'no-new': "error";
|
|
299
|
+
readonly 'no-new-func': "error";
|
|
300
|
+
readonly 'no-new-object': "error";
|
|
301
|
+
readonly 'no-new-symbol': "error";
|
|
302
|
+
readonly 'no-new-wrappers': "error";
|
|
303
|
+
readonly 'no-obj-calls': "error";
|
|
304
|
+
readonly 'no-octal': "error";
|
|
305
|
+
readonly 'no-octal-escape': "error";
|
|
306
|
+
readonly 'no-proto': "error";
|
|
307
|
+
readonly 'no-redeclare': readonly ["error", {
|
|
308
|
+
readonly builtinGlobals: false;
|
|
309
|
+
}];
|
|
310
|
+
readonly 'no-regex-spaces': "error";
|
|
311
|
+
readonly 'no-return-assign': readonly ["error", "except-parens"];
|
|
312
|
+
readonly 'no-self-assign': readonly ["error", {
|
|
313
|
+
readonly props: true;
|
|
314
|
+
}];
|
|
315
|
+
readonly 'no-self-compare': "error";
|
|
316
|
+
readonly 'no-sequences': "error";
|
|
317
|
+
readonly 'no-shadow-restricted-names': "error";
|
|
318
|
+
readonly 'no-sparse-arrays': "error";
|
|
319
|
+
readonly 'no-template-curly-in-string': "error";
|
|
320
|
+
readonly 'no-this-before-super': "error";
|
|
321
|
+
readonly 'no-throw-literal': "error";
|
|
322
|
+
readonly 'no-undef': "error";
|
|
323
|
+
readonly 'no-unmodified-loop-condition': "error";
|
|
324
|
+
readonly 'no-unneeded-ternary': readonly ["error", {
|
|
325
|
+
readonly defaultAssignment: false;
|
|
326
|
+
}];
|
|
327
|
+
readonly 'no-unreachable': "error";
|
|
328
|
+
readonly 'no-unreachable-loop': "error";
|
|
329
|
+
readonly 'no-unsafe-finally': "error";
|
|
330
|
+
readonly 'no-unsafe-negation': "error";
|
|
331
|
+
readonly 'no-unused-expressions': readonly ["error", {
|
|
332
|
+
readonly allowShortCircuit: true;
|
|
333
|
+
readonly allowTernary: true;
|
|
334
|
+
readonly allowTaggedTemplates: true;
|
|
335
|
+
}];
|
|
336
|
+
readonly 'no-unused-vars': readonly ["error", {
|
|
337
|
+
readonly args: "none";
|
|
338
|
+
readonly caughtErrors: "none";
|
|
339
|
+
readonly ignoreRestSiblings: true;
|
|
340
|
+
readonly vars: "all";
|
|
341
|
+
}];
|
|
342
|
+
readonly 'no-use-before-define': readonly ["error", {
|
|
343
|
+
readonly functions: false;
|
|
344
|
+
readonly classes: false;
|
|
345
|
+
readonly variables: false;
|
|
346
|
+
}];
|
|
347
|
+
readonly 'no-useless-call': "error";
|
|
348
|
+
readonly 'no-useless-computed-key': "error";
|
|
349
|
+
readonly 'no-useless-constructor': "error";
|
|
350
|
+
readonly 'no-useless-escape': "error";
|
|
351
|
+
readonly 'no-useless-rename': "error";
|
|
352
|
+
readonly 'no-useless-return': "error";
|
|
353
|
+
readonly 'no-void': "error";
|
|
354
|
+
readonly 'no-with': "error";
|
|
355
|
+
readonly 'one-var': readonly ["error", {
|
|
356
|
+
readonly initialized: "never";
|
|
357
|
+
}];
|
|
358
|
+
readonly 'prefer-const': readonly ["error", {
|
|
359
|
+
readonly destructuring: "all";
|
|
360
|
+
}];
|
|
361
|
+
readonly 'prefer-promise-reject-errors': "error";
|
|
362
|
+
readonly 'prefer-regex-literals': readonly ["error", {
|
|
363
|
+
readonly disallowRedundantWrapping: true;
|
|
364
|
+
}];
|
|
365
|
+
readonly 'spaced-comment': readonly ["error", "always", {
|
|
366
|
+
readonly line: {
|
|
367
|
+
readonly markers: readonly ["*package", "!", "/", ",", "="];
|
|
368
|
+
};
|
|
369
|
+
readonly block: {
|
|
370
|
+
readonly balanced: true;
|
|
371
|
+
readonly markers: readonly ["*package", "!", ",", ":", "::", "flow-include"];
|
|
372
|
+
readonly exceptions: readonly ["*"];
|
|
373
|
+
};
|
|
374
|
+
}];
|
|
375
|
+
readonly 'symbol-description': "error";
|
|
376
|
+
readonly 'unicode-bom': readonly ["error", "never"];
|
|
377
|
+
readonly 'use-isnan': readonly ["error", {
|
|
378
|
+
readonly enforceForSwitchCase: true;
|
|
379
|
+
readonly enforceForIndexOf: true;
|
|
380
|
+
}];
|
|
381
|
+
readonly 'valid-typeof': readonly ["error", {
|
|
382
|
+
readonly requireStringLiterals: true;
|
|
383
|
+
}];
|
|
384
|
+
readonly yoda: readonly ["error", "never"];
|
|
385
|
+
readonly 'import/export': "error";
|
|
386
|
+
readonly 'import/first': "error";
|
|
387
|
+
readonly 'import/no-absolute-path': readonly ["error", {
|
|
388
|
+
readonly esmodule: true;
|
|
389
|
+
readonly commonjs: true;
|
|
390
|
+
readonly amd: false;
|
|
391
|
+
}];
|
|
392
|
+
readonly 'import/no-duplicates': "error";
|
|
393
|
+
readonly 'import/no-named-default': "error";
|
|
394
|
+
readonly 'import/no-webpack-loader-syntax': "error";
|
|
395
|
+
readonly 'n/handle-callback-err': readonly ["error", "^(err|error)$"];
|
|
396
|
+
readonly 'n/no-callback-literal': "error";
|
|
397
|
+
readonly 'n/no-deprecated-api': "error";
|
|
398
|
+
readonly 'n/no-exports-assign': "error";
|
|
399
|
+
readonly 'n/no-new-require': "error";
|
|
400
|
+
readonly 'n/no-path-concat': "error";
|
|
401
|
+
readonly 'n/process-exit-as-throw': "error";
|
|
402
|
+
readonly 'promise/param-names': "error";
|
|
403
|
+
};
|
|
404
|
+
}, {
|
|
405
|
+
readonly name: "fenge/javascript/config";
|
|
406
|
+
readonly files: readonly ["**/*.config.{js,cjs,mjs,jsx}"];
|
|
407
|
+
readonly rules: {
|
|
408
|
+
readonly "import/no-default-export": "off";
|
|
409
|
+
};
|
|
410
|
+
}, {
|
|
411
|
+
readonly name: "fenge/javascript/test";
|
|
412
|
+
readonly files: readonly ["**/__tests__/**/*.{js,cjs,mjs,jsx}", "**/*.{test,spec}.{js,cjs,mjs,jsx}"];
|
|
413
|
+
readonly rules: {
|
|
414
|
+
readonly "esm/no-phantom-dep-imports": readonly ["error", {
|
|
415
|
+
readonly allowDevDependencies: true;
|
|
416
|
+
}];
|
|
417
|
+
};
|
|
418
|
+
}];
|
|
419
|
+
//# sourceMappingURL=javascript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../src/config/javascript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,sBAAsB,CAAC;AAIpD,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAK/C,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAG9C,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAIlD,wBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;6CAFV,QAAQ;6CAGM,QAAQ;oCAC/B,QAAQ;kDAGF,QAAQ;kDAEwB,QAAQ;2CACrB,QAAQ;iDAEnB,QACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqVQ;;;WAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiHV"}
|