@ota-meshi/eslint-plugin 0.16.1 → 0.17.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/lib/config-builder/+astro-with-ts.d.ts +2 -0
- package/lib/config-builder/+astro.d.ts +2 -0
- package/lib/config-builder/+eslint-plugin.d.ts +2 -0
- package/lib/config-builder/+json.d.ts +2 -0
- package/lib/config-builder/+md.d.ts +2 -0
- package/lib/config-builder/+md.js +1 -0
- package/lib/config-builder/+node.d.ts +2 -0
- package/lib/config-builder/+package-json.d.ts +2 -0
- package/lib/config-builder/+prettier.d.ts +2 -0
- package/lib/config-builder/+svelte-with-ts.d.ts +2 -0
- package/lib/config-builder/+svelte.d.ts +2 -0
- package/lib/config-builder/+toml.d.ts +2 -0
- package/lib/config-builder/+typescript.d.ts +2 -0
- package/lib/config-builder/+vue2-with-ts.d.ts +2 -0
- package/lib/config-builder/+vue2.d.ts +2 -0
- package/lib/config-builder/+vue3-with-ts.d.ts +2 -0
- package/lib/config-builder/+vue3.d.ts +2 -0
- package/lib/config-builder/+yaml.d.ts +2 -0
- package/lib/config-builder/base-plugins/eslint-comments.d.ts +2 -0
- package/lib/config-builder/base-plugins/jsdoc.d.ts +2 -0
- package/lib/config-builder/base-plugins/jsdoc.js +20 -0
- package/lib/config-builder/base-plugins/regexp.d.ts +2 -0
- package/lib/config-builder/fallback.d.ts +5 -0
- package/lib/config-builder/index.d.ts +20 -0
- package/lib/config-builder/plugins/json-schema.d.ts +2 -0
- package/lib/config-builder/plugins/ts/base-config.d.ts +2 -0
- package/lib/config-builder/plugins/ts/base-config.js +4 -0
- package/lib/config-builder/plugins/ts/index.d.ts +1 -0
- package/lib/config-builder/recommended.d.ts +5 -0
- package/lib/config-builder/recommended.js +2 -0
- package/lib/config-helpers/+astro.d.ts +3 -0
- package/lib/config-helpers/+eslint-plugin.d.ts +3 -0
- package/lib/config-helpers/+json.d.ts +3 -0
- package/lib/config-helpers/+md.d.ts +5 -0
- package/lib/config-helpers/+node.d.ts +11 -0
- package/lib/config-helpers/+package-json.d.ts +1 -0
- package/lib/config-helpers/+prettier.d.ts +3 -0
- package/lib/config-helpers/+svelte.d.ts +3 -0
- package/lib/config-helpers/+toml.d.ts +3 -0
- package/lib/config-helpers/+typescript.d.ts +4 -0
- package/lib/config-helpers/+vue.d.ts +3 -0
- package/lib/config-helpers/+yaml.d.ts +3 -0
- package/lib/config-helpers/base-plugins/eslint-comments.d.ts +2 -0
- package/lib/config-helpers/base-plugins/jsdoc.d.ts +2 -0
- package/lib/config-helpers/base-plugins/jsdoc.js +6 -0
- package/lib/config-helpers/base-plugins/regexp.d.ts +2 -0
- package/lib/config-helpers/plugins/json-schema.d.ts +2 -0
- package/lib/config-helpers/plugins/ts/base-config.d.ts +2 -0
- package/lib/config-helpers/plugins/ts/base-config.js +2 -0
- package/lib/config-helpers/plugins/ts/index.d.ts +7 -0
- package/lib/config-helpers/recommended.d.ts +5 -0
- package/lib/config-helpers/recommended.js +1 -2
- package/lib/configs/+eslint-plugin.d.ts +3 -0
- package/lib/configs/+json.d.ts +3 -0
- package/lib/configs/+md.d.ts +3 -0
- package/lib/configs/+node.d.ts +3 -0
- package/lib/configs/+package-json.d.ts +3 -0
- package/lib/configs/+prettier.d.ts +3 -0
- package/lib/configs/+svelte-with-ts.d.ts +3 -0
- package/lib/configs/+svelte.d.ts +3 -0
- package/lib/configs/+toml.d.ts +3 -0
- package/lib/configs/+typescript.d.ts +3 -0
- package/lib/configs/+typescript.js +5 -0
- package/lib/configs/+vue2-with-ts.d.ts +3 -0
- package/lib/configs/+vue2.d.ts +3 -0
- package/lib/configs/+vue3-with-ts.d.ts +3 -0
- package/lib/configs/+vue3.d.ts +3 -0
- package/lib/configs/+yaml.d.ts +3 -0
- package/lib/configs/base-plugins/eslint-comments.d.ts +3 -0
- package/lib/configs/base-plugins/jsdoc.d.ts +3 -0
- package/lib/configs/base-plugins/jsdoc.js +10 -0
- package/lib/configs/base-plugins/regexp.d.ts +3 -0
- package/lib/configs/fallback.d.ts +5 -0
- package/lib/configs/json-schema/config.d.ts +3 -0
- package/lib/configs/recommended.d.ts +26 -0
- package/lib/configs/recommended.js +1 -0
- package/lib/configs/ts/base-config.d.ts +10 -0
- package/lib/configs/ts/index.d.ts +2 -0
- package/lib/index.d.ts +48 -0
- package/lib/parsers/any-parser.d.ts +5 -0
- package/lib/rules/missing-module-for-config.d.ts +16 -0
- package/lib/utils/find-root-dir.d.ts +1 -0
- package/lib/utils/get-linters.d.ts +1 -0
- package/lib/utils/module.d.ts +19 -0
- package/package.json +2 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildJsdoc = void 0;
|
|
4
|
+
const module_js_1 = require("../../utils/module.js");
|
|
5
|
+
const fallback_js_1 = require("../fallback.js");
|
|
6
|
+
const jsdoc_js_1 = require("../../config-helpers/base-plugins/jsdoc.js");
|
|
7
|
+
function buildJsdoc() {
|
|
8
|
+
return (0, module_js_1.requireOf)(["eslint-plugin-jsdoc"], () => {
|
|
9
|
+
const jsdoc = require("eslint-plugin-jsdoc");
|
|
10
|
+
return [
|
|
11
|
+
{
|
|
12
|
+
plugins: { jsdoc },
|
|
13
|
+
rules: {
|
|
14
|
+
...jsdoc_js_1.jsdocRules,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}, fallback_js_1.buildFallback);
|
|
19
|
+
}
|
|
20
|
+
exports.buildJsdoc = buildJsdoc;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Linter } from "eslint";
|
|
2
|
+
export type BuildConfigOptions = {
|
|
3
|
+
node?: boolean;
|
|
4
|
+
packageJson?: boolean;
|
|
5
|
+
eslintPlugin?: boolean;
|
|
6
|
+
vue3?: boolean;
|
|
7
|
+
vue2?: boolean;
|
|
8
|
+
svelte?: boolean;
|
|
9
|
+
astro?: boolean;
|
|
10
|
+
ts?: boolean;
|
|
11
|
+
json?: boolean;
|
|
12
|
+
yaml?: boolean;
|
|
13
|
+
toml?: boolean;
|
|
14
|
+
md?: boolean;
|
|
15
|
+
prettier?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build config
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildConfig(options: BuildConfigOptions): Linter.FlatConfig[];
|
|
@@ -5,6 +5,7 @@ const module_js_1 = require("../../../utils/module.js");
|
|
|
5
5
|
const index_js_1 = require("../../../config-helpers/plugins/ts/index.js");
|
|
6
6
|
const fallback_js_1 = require("../../fallback.js");
|
|
7
7
|
const any_parser_js_1 = require("../../../parsers/any-parser.js");
|
|
8
|
+
const _md_js_1 = require("../../../config-helpers/+md.js");
|
|
8
9
|
function buildTS(files) {
|
|
9
10
|
return (0, module_js_1.requireOf)([
|
|
10
11
|
"typescript",
|
|
@@ -29,6 +30,9 @@ function buildTS(files) {
|
|
|
29
30
|
rules: {
|
|
30
31
|
...index_js_1.tsExtendRules,
|
|
31
32
|
},
|
|
33
|
+
}, {
|
|
34
|
+
files: _md_js_1.extInMdFiles,
|
|
35
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
32
36
|
}),
|
|
33
37
|
];
|
|
34
38
|
}, (missingList) => [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { buildTS } from "./base-config.js";
|
|
@@ -9,6 +9,7 @@ const js_1 = __importDefault(require("@eslint/js"));
|
|
|
9
9
|
const eslint_comments_js_1 = require("./base-plugins/eslint-comments.js");
|
|
10
10
|
const regexp_js_1 = require("./base-plugins/regexp.js");
|
|
11
11
|
const recommended_js_1 = require("../config-helpers/recommended.js");
|
|
12
|
+
const jsdoc_js_1 = require("./base-plugins/jsdoc.js");
|
|
12
13
|
/**
|
|
13
14
|
* Build recommended config
|
|
14
15
|
*/
|
|
@@ -17,6 +18,7 @@ function buildRecommended() {
|
|
|
17
18
|
js_1.default.configs.recommended,
|
|
18
19
|
...(0, eslint_comments_js_1.buildESLintComments)(),
|
|
19
20
|
...(0, regexp_js_1.buildRegexp)(),
|
|
21
|
+
...(0, jsdoc_js_1.buildJsdoc)(),
|
|
20
22
|
{
|
|
21
23
|
rules: {
|
|
22
24
|
...recommended_js_1.recommendedRules,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Linter } from "eslint";
|
|
2
|
+
export declare const nodeFiles: string[];
|
|
3
|
+
export declare const nodeEcmaFeatures: {
|
|
4
|
+
globalReturn: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const nodeExtendRules: Linter.RulesRecord;
|
|
7
|
+
export declare const nodeSettings: {
|
|
8
|
+
node: {
|
|
9
|
+
tryExtensions: string[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const packageJsonFiles: string[];
|
|
@@ -107,6 +107,8 @@ exports.tsExtendRules = {
|
|
|
107
107
|
varsIgnorePattern: "^_(?:[^_].*)?$",
|
|
108
108
|
},
|
|
109
109
|
],
|
|
110
|
+
"no-shadow": "off",
|
|
111
|
+
"@typescript-eslint/no-shadow": "error",
|
|
110
112
|
// Turn off unnecessary rules
|
|
111
113
|
"n/no-unsupported-features/es-syntax": "off",
|
|
112
114
|
"n/no-missing-import": "off",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ESLint, Linter } from "eslint";
|
|
2
|
+
export declare const recommendedRules: Linter.RulesRecord;
|
|
3
|
+
export declare const recommendedTestFiles: string[];
|
|
4
|
+
export declare const recommendedTestRules: Linter.RulesRecord;
|
|
5
|
+
export declare const recommendedTestGlobals: ESLint.Globals | undefined;
|
|
@@ -23,7 +23,6 @@ exports.recommendedRules = {
|
|
|
23
23
|
"no-useless-concat": "error",
|
|
24
24
|
"no-new-object": "error",
|
|
25
25
|
"no-tabs": "error",
|
|
26
|
-
"require-jsdoc": "error",
|
|
27
26
|
"prefer-template": "error",
|
|
28
27
|
"object-shorthand": "error",
|
|
29
28
|
"array-callback-return": "error",
|
|
@@ -225,7 +224,7 @@ exports.recommendedTestFiles = [
|
|
|
225
224
|
"tests/**/*.cts",
|
|
226
225
|
];
|
|
227
226
|
exports.recommendedTestRules = {
|
|
228
|
-
"require-jsdoc": "off",
|
|
227
|
+
"jsdoc/require-jsdoc": "off",
|
|
229
228
|
"no-console": "off",
|
|
230
229
|
};
|
|
231
230
|
exports.recommendedTestGlobals = {
|
|
@@ -26,6 +26,7 @@ const _typescript_js_1 = require("../config-helpers/+typescript.js");
|
|
|
26
26
|
const module_js_1 = require("../utils/module.js");
|
|
27
27
|
const base = __importStar(require("./ts/base-config.js"));
|
|
28
28
|
const fallback_js_1 = require("./fallback.js");
|
|
29
|
+
const _md_js_1 = require("../config-helpers/+md.js");
|
|
29
30
|
module.exports = (0, module_js_1.requireOf)([
|
|
30
31
|
"@typescript-eslint/parser",
|
|
31
32
|
"typescript",
|
|
@@ -43,6 +44,10 @@ module.exports = (0, module_js_1.requireOf)([
|
|
|
43
44
|
..._typescript_js_1.tsTestExtendRules,
|
|
44
45
|
},
|
|
45
46
|
},
|
|
47
|
+
{
|
|
48
|
+
files: _md_js_1.extInMdFiles,
|
|
49
|
+
extends: ["plugin:@typescript-eslint/disable-type-checked"],
|
|
50
|
+
},
|
|
46
51
|
],
|
|
47
52
|
}), (missingList) => ({
|
|
48
53
|
overrides: [
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const module_js_1 = require("../../utils/module.js");
|
|
3
|
+
const fallback_js_1 = require("../fallback.js");
|
|
4
|
+
const jsdoc_js_1 = require("../../config-helpers/base-plugins/jsdoc.js");
|
|
5
|
+
module.exports = (0, module_js_1.requireOf)(["eslint-plugin-jsdoc"], () => ({
|
|
6
|
+
plugins: ["jsdoc"],
|
|
7
|
+
rules: {
|
|
8
|
+
...jsdoc_js_1.jsdocRules,
|
|
9
|
+
},
|
|
10
|
+
}), fallback_js_1.buildFallbackForLegacy);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
extends: string[];
|
|
3
|
+
parserOptions: {
|
|
4
|
+
sourceType: string;
|
|
5
|
+
ecmaVersion: number;
|
|
6
|
+
};
|
|
7
|
+
rules: {
|
|
8
|
+
[x: string]: import("eslint").Linter.RuleEntry<any[]>;
|
|
9
|
+
};
|
|
10
|
+
overrides: ({
|
|
11
|
+
files: string[];
|
|
12
|
+
extends: string[];
|
|
13
|
+
globals?: undefined;
|
|
14
|
+
rules?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
files: string[];
|
|
17
|
+
globals: {
|
|
18
|
+
[x: string]: boolean | "off" | "writable" | "readonly";
|
|
19
|
+
};
|
|
20
|
+
rules: {
|
|
21
|
+
[x: string]: import("eslint").Linter.RuleEntry<any[]>;
|
|
22
|
+
};
|
|
23
|
+
extends?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
};
|
|
26
|
+
export = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const extendsArray: string[];
|
|
2
|
+
export { extendsArray as extends };
|
|
3
|
+
export declare const parserOptions: {
|
|
4
|
+
project: string | undefined;
|
|
5
|
+
extraFileExtensions: string[];
|
|
6
|
+
sourceType: "module";
|
|
7
|
+
};
|
|
8
|
+
export declare const rules: {
|
|
9
|
+
[x: string]: import("eslint").Linter.RuleEntry<any[]>;
|
|
10
|
+
};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BuildConfigOptions } from "./config-builder/index.js";
|
|
2
|
+
export declare function config(options?: BuildConfigOptions): import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
|
|
3
|
+
export declare const configs: {
|
|
4
|
+
recommended: any;
|
|
5
|
+
"+eslint-plugin": any;
|
|
6
|
+
"+json": any;
|
|
7
|
+
"+node": any;
|
|
8
|
+
"+prettier": any;
|
|
9
|
+
"+typescript": any;
|
|
10
|
+
"+vue2": any;
|
|
11
|
+
"+vue2-with-ts": any;
|
|
12
|
+
"+vue3": any;
|
|
13
|
+
"+vue3-with-ts": any;
|
|
14
|
+
"+svelte": any;
|
|
15
|
+
"+svelte-with-ts": any;
|
|
16
|
+
"+yaml": any;
|
|
17
|
+
"+toml": any;
|
|
18
|
+
"+md": any;
|
|
19
|
+
"+package-json": any;
|
|
20
|
+
};
|
|
21
|
+
export declare const rules: {
|
|
22
|
+
"missing-module-for-config": any;
|
|
23
|
+
};
|
|
24
|
+
declare const _default: {
|
|
25
|
+
config: typeof config;
|
|
26
|
+
configs: {
|
|
27
|
+
recommended: any;
|
|
28
|
+
"+eslint-plugin": any;
|
|
29
|
+
"+json": any;
|
|
30
|
+
"+node": any;
|
|
31
|
+
"+prettier": any;
|
|
32
|
+
"+typescript": any;
|
|
33
|
+
"+vue2": any;
|
|
34
|
+
"+vue2-with-ts": any;
|
|
35
|
+
"+vue3": any;
|
|
36
|
+
"+vue3-with-ts": any;
|
|
37
|
+
"+svelte": any;
|
|
38
|
+
"+svelte-with-ts": any;
|
|
39
|
+
"+yaml": any;
|
|
40
|
+
"+toml": any;
|
|
41
|
+
"+md": any;
|
|
42
|
+
"+package-json": any;
|
|
43
|
+
};
|
|
44
|
+
rules: {
|
|
45
|
+
"missing-module-for-config": any;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Rule } from "eslint";
|
|
2
|
+
export declare const meta: {
|
|
3
|
+
type: string;
|
|
4
|
+
docs: {
|
|
5
|
+
description: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
fixable: string;
|
|
9
|
+
schema: {
|
|
10
|
+
type: string;
|
|
11
|
+
items: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
export declare function create(context: Rule.RuleContext): {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findRootDir(startPath: string): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getLinters(): any[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Linter } from "eslint";
|
|
2
|
+
export declare function requireFromCwd(modulePath: string): any;
|
|
3
|
+
export declare function resolveFromCwd(modulePath: string): string;
|
|
4
|
+
export declare function parseModule(name: string): {
|
|
5
|
+
moduleName: string;
|
|
6
|
+
version: string;
|
|
7
|
+
} | {
|
|
8
|
+
moduleName: string;
|
|
9
|
+
version: null;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Checks if exists module
|
|
13
|
+
*/
|
|
14
|
+
export declare function has(name: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Checks exists module and return config
|
|
17
|
+
*/
|
|
18
|
+
export declare function requireOf<C extends Linter.FlatConfig[] | Linter.Config>(names: string[], getConfig: () => C, fallback: (missingList: string[]) => C): C;
|
|
19
|
+
export declare function tryInstall(moduleName: string, targetFile?: string): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ota-meshi/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "ESLint configuration plugin for me.",
|
|
5
5
|
"repository": "git+https://github.com/ota-meshi/eslint-plugin.git",
|
|
6
6
|
"homepage": "https://github.com/ota-meshi/eslint-plugin#readme",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"eslint-config-prettier": "^9.0.0",
|
|
45
45
|
"eslint-plugin-astro": "^0.34.0",
|
|
46
46
|
"eslint-plugin-eslint-plugin": "^6.0.0",
|
|
47
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
47
48
|
"eslint-plugin-json-schema-validator": "^5.0.0",
|
|
48
49
|
"eslint-plugin-jsonc": "^2.0.0",
|
|
49
50
|
"eslint-plugin-markdown": "^4.0.0",
|