eslint-plugin-function-rule 0.0.10 → 0.0.11

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 CHANGED
@@ -43,10 +43,10 @@ export default defineConfig(
43
43
  {
44
44
  files: ["**/*.ts"],
45
45
  rules: {
46
- "function-rule/v1": "error",
46
+ "function-rule/function-rule": "error",
47
47
  },
48
48
  plugins: {
49
- "function-rule": defineRule("v1", (context) => {
49
+ "function-rule": defineRule((context) => {
50
50
  return {
51
51
  DebuggerStatement(node) {
52
52
  context.report({
@@ -93,10 +93,13 @@ export function noDebugger(options?: noDebuggerOptions) {
93
93
  }
94
94
  ```
95
95
 
96
+ ### Define function rule with default prefix
97
+
96
98
  ```js
97
99
  // eslint.config.ts
98
100
 
99
101
  // ...
102
+ import { defineRule } from "eslint-plugin-function-rule";
100
103
  import { noDebugger } from "./noDebugger.ts";
101
104
 
102
105
  export default defineConfig(
@@ -104,10 +107,39 @@ export default defineConfig(
104
107
  {
105
108
  files: ["**/*.ts"],
106
109
  rules: {
107
- "no-debugger/v1": "error",
110
+ "function-rule/function-rule": "error",
108
111
  },
109
112
  plugins: {
110
- "no-debugger": defineRule("v1", noDebugger({ /* pass rule options */ })),
113
+ "function-rule": defineRule(noDebugger({ /* pass rule options */ })),
114
+ },
115
+ },
116
+ );
117
+ ```
118
+
119
+ ### Define function rule with custom prefix
120
+
121
+ ```js
122
+ // eslint.config.ts
123
+
124
+ // ...
125
+ import { defineRule } from "eslint-plugin-function-rule";
126
+ import { noDebugger } from "./noDebugger.ts";
127
+
128
+ export default defineConfig(
129
+ // ...
130
+ {
131
+ files: ["**/*.ts"],
132
+ rules: {
133
+ "no-debugger/function-rule": "error",
134
+
135
+ "custom/function-rule": "error",
136
+ },
137
+ plugins: {
138
+ "no-debugger": defineRule(noDebugger({ /* pass rule options */ })),
139
+
140
+ custom: defineRule((context) => {
141
+ return { /* your won rule logic */ }
142
+ }),
111
143
  },
112
144
  },
113
145
  );
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Rule } from "eslint";
2
2
 
3
3
  //#region index.d.ts
4
- declare function defineRule(name: string, create: Rule.RuleModule["create"]): {
4
+ declare function defineRule(create: Rule.RuleModule["create"]): {
5
5
  readonly rules: {
6
- readonly [name]: {
6
+ readonly "function-rule": {
7
7
  readonly meta: {
8
8
  readonly fixable: "code";
9
9
  readonly hasSuggestions: true;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region index.ts
2
- function defineRule(name, create) {
3
- return { rules: { [name]: {
2
+ function defineRule(create) {
3
+ return { rules: { "function-rule": {
4
4
  meta: {
5
5
  fixable: "code",
6
6
  hasSuggestions: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-function-rule",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "type": "module",