@kazupon/eslint-plugin 0.1.1 → 0.2.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/index.d.ts CHANGED
@@ -1,8 +1,18 @@
1
- import { ESLint } from "eslint";
1
+ import { ESLint, Linter } from "eslint";
2
2
 
3
3
  //#region src/index.d.ts
4
- declare const plugin: ESLint.Plugin;
5
- declare const configs: ESLint.Plugin["configs"];
4
+ type PluginConfigs = {
5
+ recommended: Linter.Config<Linter.RulesRecord>[]
6
+ comment: Linter.Config<Linter.RulesRecord>[]
7
+ };
8
+ declare const plugin: Omit<ESLint.Plugin, "configs"> & {
9
+ configs: PluginConfigs
10
+ };
11
+ declare const commentConfig: Linter.Config[];
12
+ declare const configs: {
13
+ recommended: typeof commentConfig
14
+ comment: typeof commentConfig
15
+ };
6
16
 
7
17
  //#endregion
8
18
  export { configs, plugin as default, plugin };
package/lib/index.js CHANGED
@@ -1,17 +1,9 @@
1
1
  import { parseComment } from "@es-joy/jsdoccomment";
2
- import fs from "node:fs";
3
2
 
4
- //#region src/utils/package.ts
5
- function readPackageJson(path) {
6
- return JSON.parse(fs.readFileSync(path, "utf8"));
7
- }
8
-
9
- //#endregion
10
- //#region src/utils/meta.ts
11
- const pkg = readPackageJson(new URL("../../package.json", import.meta.url));
12
- const name = pkg.name;
13
- const version = pkg.version;
14
- const namespace = pkg.name.split("/")[0];
3
+ //#region src/utils/constants.ts
4
+ const name = "@kazupon/eslint-plugin";
5
+ const version = "0.2.0";
6
+ const namespace = "@kazupon";
15
7
 
16
8
  //#endregion
17
9
  //#region src/utils/rule.ts
@@ -169,12 +161,17 @@ const plugin = {
169
161
  name,
170
162
  version
171
163
  },
172
- rules
164
+ rules,
165
+ configs: {}
173
166
  };
174
167
  const commentConfig = [{
175
168
  name: "@kazupon/eslint-plugin/comment",
176
169
  files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
177
- ignores: ["**/*.md", "**/*.md/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
170
+ ignores: [
171
+ "**/*.md",
172
+ "**/*.md/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}",
173
+ "**/*.config.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"
174
+ ],
178
175
  plugins: { [namespace]: plugin },
179
176
  rules: Object.entries(rules).reduce((rules$1, [ruleName, rule$1]) => {
180
177
  const ruleId = rule$1.meta?.docs?.ruleId || (namespace ? `${namespace}/${ruleName}` : ruleName);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-plugin",
3
3
  "description": "ESLint plugin for @kazupon",
4
- "version": "0.1.1",
4
+ "version": "0.2.0",
5
5
  "license": "MIT",
6
6
  "funding": "https://github.com/sponsors/kazupon",
7
7
  "bugs": {