eslint-plugin-decimal-system 1.0.4 → 1.0.6

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
@@ -23,23 +23,27 @@ Peer dependency:
23
23
  npm install --save-dev eslint
24
24
  ```
25
25
 
26
+ ### What the plugin exports
27
+
28
+ - default → plugin (contains `rules` and `configs`)
29
+
30
+ - named export → `rules`
31
+
26
32
  ### Usage
27
- ESLint 9 (Flat Config)
33
+ ESLint 9
28
34
  ```js
35
+ import { defineConfig } from "eslint/config";
29
36
  import decimal from "eslint-plugin-decimal-system";
30
37
 
31
- export default [
32
- {
33
- plugins: {
34
- decimal,
35
- },
36
- },
38
+ export default defineConfig([
37
39
  ...decimal.configs.recommended,
38
- ];
40
+ ])
41
+
39
42
  ```
40
43
 
41
44
  Or enable manually:
42
45
  ```js
46
+ import decimal from "eslint-plugin-decimal-system";
43
47
 
44
48
  export default [
45
49
  {
@@ -50,22 +54,6 @@ export default [
50
54
  },
51
55
  ];
52
56
  ```
53
- ### Legacy Config (.eslintrc)
54
- ```js
55
- {
56
- "extends": ["plugin:decimal/recommended"]
57
- }
58
- ```
59
-
60
- Or:
61
- ```js
62
- {
63
- "plugins": ["decimal"],
64
- "rules": {
65
- "decimal/decimal-system-only": "error"
66
- }
67
- }
68
- ```
69
57
 
70
58
  ### Rule Details
71
59
 
@@ -0,0 +1,2 @@
1
+ export declare const NON_DECIMAL_REGEX: RegExp;
2
+ export declare const RULE_NAME = "decimal-system-only";
@@ -0,0 +1,2 @@
1
+ export const NON_DECIMAL_REGEX = /^0[xob]/i;
2
+ export const RULE_NAME = "decimal-system-only";
package/dist/index.d.ts CHANGED
@@ -1,23 +1,4 @@
1
- declare const plugin: {
2
- rules: {
3
- "decimal-system-only": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpected", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
- };
5
- };
6
- export declare const rules: {
7
- "decimal-system-only": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpected", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
8
- };
9
- export declare const configs: {
10
- recommended: {
11
- plugins: {
12
- decimal: {
13
- rules: {
14
- "decimal-system-only": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpected", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
15
- };
16
- };
17
- };
18
- rules: {
19
- "decimal/decimal-system-only": string;
20
- };
21
- }[];
22
- };
1
+ import { Plugin } from "./types/index.js";
2
+ declare const plugin: Plugin;
3
+ export declare const rules: Record<string, import("@typescript-eslint/utils/ts-eslint").RuleModule<string, unknown[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>>;
23
4
  export default plugin;
package/dist/index.js CHANGED
@@ -1,20 +1,26 @@
1
+ import { RULE_NAME } from "./constants/index.js";
1
2
  import decimalSystemOnly from "./rules/decimal-system-only.js";
2
3
  const plugin = {
4
+ meta: {
5
+ name: "eslint-plugin-decimal-system",
6
+ version: "1.0.6",
7
+ },
3
8
  rules: {
4
- "decimal-system-only": decimalSystemOnly,
9
+ [RULE_NAME]: decimalSystemOnly,
5
10
  },
11
+ configs: {},
6
12
  };
7
13
  export const rules = plugin.rules;
8
- export const configs = {
14
+ Object.assign(plugin.configs, {
9
15
  recommended: [
10
16
  {
11
17
  plugins: {
12
18
  decimal: plugin,
13
19
  },
14
20
  rules: {
15
- "decimal/decimal-system-only": "error",
21
+ [`decimal/${RULE_NAME}`]: "error",
16
22
  },
17
- },
18
- ],
19
- };
23
+ }
24
+ ]
25
+ });
20
26
  export default plugin;
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- import { NON_DECIMAL_REGEX } from '../regex';
2
+ import { NON_DECIMAL_REGEX } from '../constants/index.js';
3
3
  const rule = ESLintUtils.RuleCreator.withoutDocs({
4
4
  create(context) {
5
5
  return {
@@ -0,0 +1,10 @@
1
+ import type { Linter } from "eslint";
2
+ import type { RuleModule } from "@typescript-eslint/utils/ts-eslint";
3
+ export interface Plugin {
4
+ meta: {
5
+ name: string;
6
+ version: string;
7
+ };
8
+ rules: Record<string, RuleModule<string, unknown[]>>;
9
+ configs: Record<string, Linter.Config[]>;
10
+ }
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-decimal-system",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "ESLint plugin that allows only decimal numeric literals",
5
5
  "type": "module",
6
6
  "exports": {