eslint-plugin-toml 0.11.1 → 0.12.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.
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const parser = __importStar(require("toml-eslint-parser"));
27
37
  exports.default = [
package/lib/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/lib/meta.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const name = "eslint-plugin-toml";
2
- export declare const version = "0.11.1";
2
+ export declare const version = "0.12.0";
package/lib/meta.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = "eslint-plugin-toml";
5
- exports.version = "0.11.1";
5
+ exports.version = "0.12.0";
@@ -44,7 +44,7 @@ exports.default = (0, utils_1.createRule)("array-bracket-newline", {
44
44
  },
45
45
  create(context) {
46
46
  const sourceCode = (0, compat_1.getSourceCode)(context);
47
- if (!sourceCode.parserServices.isTOML) {
47
+ if (!sourceCode.parserServices?.isTOML) {
48
48
  return {};
49
49
  }
50
50
  function normalizeOptionValue(option) {
@@ -42,7 +42,7 @@ exports.default = (0, utils_1.createRule)("array-bracket-spacing", {
42
42
  },
43
43
  create(context) {
44
44
  const sourceCode = (0, compat_1.getSourceCode)(context);
45
- if (!sourceCode.parserServices.isTOML) {
45
+ if (!sourceCode.parserServices?.isTOML) {
46
46
  return {};
47
47
  }
48
48
  const spaced = (context.options[0] || "always") === "always";
@@ -70,7 +70,7 @@ exports.default = (0, utils_1.createRule)("array-element-newline", {
70
70
  },
71
71
  create(context) {
72
72
  const sourceCode = (0, compat_1.getSourceCode)(context);
73
- if (!sourceCode.parserServices.isTOML) {
73
+ if (!sourceCode.parserServices?.isTOML) {
74
74
  return {};
75
75
  }
76
76
  function normalizeOptionValue(providedOption) {
@@ -39,7 +39,7 @@ exports.default = (0, utils_1.createRule)("comma-style", {
39
39
  create(context) {
40
40
  var _a;
41
41
  const sourceCode = (0, compat_1.getSourceCode)(context);
42
- if (!sourceCode.parserServices.isTOML) {
42
+ if (!sourceCode.parserServices?.isTOML) {
43
43
  return {};
44
44
  }
45
45
  const style = context.options[0] || "last";
@@ -53,7 +53,7 @@ exports.default = (0, utils_1.createRule)("indent", {
53
53
  },
54
54
  create(context) {
55
55
  const sourceCode = (0, compat_1.getSourceCode)(context);
56
- if (!sourceCode.parserServices.isTOML) {
56
+ if (!sourceCode.parserServices?.isTOML) {
57
57
  return {};
58
58
  }
59
59
  const { getIndentText, outdent } = buildIndentUtility(context.options[0]);
@@ -39,7 +39,7 @@ exports.default = (0, utils_1.createRule)("inline-table-curly-spacing", {
39
39
  },
40
40
  create(context) {
41
41
  const sourceCode = (0, compat_1.getSourceCode)(context);
42
- if (!sourceCode.parserServices.isTOML) {
42
+ if (!sourceCode.parserServices?.isTOML) {
43
43
  return {};
44
44
  }
45
45
  const spaced = (context.options[0] || "always") === "always";
@@ -170,7 +170,7 @@ exports.default = (0, utils_1.createRule)("key-spacing", {
170
170
  });
171
171
  function create(context) {
172
172
  const sourceCode = (0, compat_1.getSourceCode)(context);
173
- if (!sourceCode.parserServices.isTOML) {
173
+ if (!sourceCode.parserServices?.isTOML) {
174
174
  return {};
175
175
  }
176
176
  const options = context.options[0] || {};
@@ -23,7 +23,7 @@ exports.default = (0, utils_1.createRule)("keys-order", {
23
23
  },
24
24
  create(context) {
25
25
  const sourceCode = (0, compat_1.getSourceCode)(context);
26
- if (!sourceCode.parserServices.isTOML) {
26
+ if (!sourceCode.parserServices?.isTOML) {
27
27
  return {};
28
28
  }
29
29
  function applyKey(tableKeys, node) {
@@ -40,7 +40,7 @@ exports.default = (0, utils_1.createRule)("no-mixed-type-in-array", {
40
40
  },
41
41
  create(context) {
42
42
  const sourceCode = (0, compat_1.getSourceCode)(context);
43
- if (!sourceCode.parserServices.isTOML) {
43
+ if (!sourceCode.parserServices?.isTOML) {
44
44
  return {};
45
45
  }
46
46
  const typeMap = {
@@ -52,7 +52,7 @@ exports.default = (0, utils_1.createRule)("no-non-decimal-integer", {
52
52
  },
53
53
  create(context) {
54
54
  const sourceCode = (0, compat_1.getSourceCode)(context);
55
- if (!sourceCode.parserServices.isTOML) {
55
+ if (!sourceCode.parserServices?.isTOML) {
56
56
  return {};
57
57
  }
58
58
  const allowHexadecimal = Boolean(context.options[0]?.allowHexadecimal);
@@ -19,7 +19,7 @@ exports.default = (0, utils_1.createRule)("no-space-dots", {
19
19
  },
20
20
  create(context) {
21
21
  const sourceCode = (0, compat_1.getSourceCode)(context);
22
- if (!sourceCode.parserServices.isTOML) {
22
+ if (!sourceCode.parserServices?.isTOML) {
23
23
  return {};
24
24
  }
25
25
  return {
@@ -17,7 +17,7 @@ exports.default = (0, utils_1.createRule)("no-unreadable-number-separator", {
17
17
  },
18
18
  create(context) {
19
19
  const sourceCode = (0, compat_1.getSourceCode)(context);
20
- if (!sourceCode.parserServices.isTOML) {
20
+ if (!sourceCode.parserServices?.isTOML) {
21
21
  return {};
22
22
  }
23
23
  function parseCharCounts(text, startIndex, exitChars) {
@@ -20,7 +20,7 @@ exports.default = (0, utils_1.createRule)("padding-line-between-pairs", {
20
20
  },
21
21
  create(context) {
22
22
  const sourceCode = (0, compat_1.getSourceCode)(context);
23
- if (!sourceCode.parserServices.isTOML) {
23
+ if (!sourceCode.parserServices?.isTOML) {
24
24
  return {};
25
25
  }
26
26
  function verifyPairs(prevNode, prevKeys, nextNode, nextKeys) {
@@ -19,7 +19,7 @@ exports.default = (0, utils_1.createRule)("padding-line-between-tables", {
19
19
  },
20
20
  create(context) {
21
21
  const sourceCode = (0, compat_1.getSourceCode)(context);
22
- if (!sourceCode.parserServices.isTOML) {
22
+ if (!sourceCode.parserServices?.isTOML) {
23
23
  return {};
24
24
  }
25
25
  function verifyTables(prevNode, nextNode) {
@@ -28,7 +28,7 @@ exports.default = (0, utils_1.createRule)("precision-of-fractional-seconds", {
28
28
  },
29
29
  create(context) {
30
30
  const sourceCode = (0, compat_1.getSourceCode)(context);
31
- if (!sourceCode.parserServices.isTOML) {
31
+ if (!sourceCode.parserServices?.isTOML) {
32
32
  return {};
33
33
  }
34
34
  const max = context.options[0]?.max ?? 3;
@@ -36,7 +36,7 @@ exports.default = (0, utils_1.createRule)("precision-of-integer", {
36
36
  },
37
37
  create(context) {
38
38
  const sourceCode = (0, compat_1.getSourceCode)(context);
39
- if (!sourceCode.parserServices.isTOML) {
39
+ if (!sourceCode.parserServices?.isTOML) {
40
40
  return {};
41
41
  }
42
42
  const maxBit = context.options[0]?.maxBit ?? 64;
@@ -33,7 +33,7 @@ exports.default = (0, utils_1.createRule)("quoted-keys", {
33
33
  },
34
34
  create(context) {
35
35
  const sourceCode = (0, compat_1.getSourceCode)(context);
36
- if (!sourceCode.parserServices.isTOML) {
36
+ if (!sourceCode.parserServices?.isTOML) {
37
37
  return {};
38
38
  }
39
39
  const prefer = context.options[0]?.prefer ?? "as-needed";
@@ -20,7 +20,7 @@ exports.default = (0, utils_1.createRule)("space-eq-sign", {
20
20
  },
21
21
  create(context) {
22
22
  const sourceCode = (0, compat_1.getSourceCode)(context);
23
- if (!sourceCode.parserServices.isTOML) {
23
+ if (!sourceCode.parserServices?.isTOML) {
24
24
  return {};
25
25
  }
26
26
  function report(equalToken) {
@@ -90,7 +90,7 @@ exports.default = (0, utils_1.createRule)("spaced-comment", {
90
90
  },
91
91
  create(context) {
92
92
  const sourceCode = (0, compat_1.getSourceCode)(context);
93
- if (!sourceCode.parserServices.isTOML) {
93
+ if (!sourceCode.parserServices?.isTOML) {
94
94
  return {};
95
95
  }
96
96
  const requireSpace = context.options[0] !== "never";
@@ -25,7 +25,7 @@ exports.default = (0, utils_1.createRule)("table-bracket-spacing", {
25
25
  },
26
26
  create(context) {
27
27
  const sourceCode = (0, compat_1.getSourceCode)(context);
28
- if (!sourceCode.parserServices.isTOML) {
28
+ if (!sourceCode.parserServices?.isTOML) {
29
29
  return {};
30
30
  }
31
31
  const prefer = context.options[0] || "never";
@@ -38,7 +38,7 @@ exports.default = (0, utils_1.createRule)("tables-order", {
38
38
  },
39
39
  create(context) {
40
40
  const sourceCode = (0, compat_1.getSourceCode)(context);
41
- if (!sourceCode.parserServices.isTOML) {
41
+ if (!sourceCode.parserServices?.isTOML) {
42
42
  return {};
43
43
  }
44
44
  function applyKey(rootKeys, node) {
@@ -19,7 +19,7 @@ exports.default = (0, utils_1.createRule)("vue-custom-block/no-parsing-error", {
19
19
  }
20
20
  const sourceCode = (0, compat_1.getSourceCode)(context);
21
21
  const parserServices = context.parserServices ?? sourceCode.parserServices;
22
- const parseError = parserServices.parseError;
22
+ const parseError = parserServices?.parseError;
23
23
  if (parseError) {
24
24
  let loc = undefined;
25
25
  if ("column" in parseError && "lineNumber" in parseError) {
package/lib/types.d.ts CHANGED
@@ -75,7 +75,7 @@ export interface RuleContext {
75
75
  id: string;
76
76
  options: any[];
77
77
  parserPath: string;
78
- parserServices: {
78
+ parserServices?: {
79
79
  isTOML?: true;
80
80
  parseError?: any;
81
81
  };
@@ -94,8 +94,9 @@ export interface SourceCode {
94
94
  ast: AST.TOMLProgram;
95
95
  lines: string[];
96
96
  hasBOM: boolean;
97
- parserServices: {
97
+ parserServices?: {
98
98
  isTOML?: true;
99
+ parseError?: any;
99
100
  };
100
101
  visitorKeys: {
101
102
  [nodeType: string]: string[];
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -43,10 +53,10 @@ function createRule(ruleName, rule) {
43
53
  },
44
54
  create(context) {
45
55
  const sourceCode = (0, compat_1.getSourceCode)(context);
46
- if (typeof sourceCode.parserServices.defineCustomBlocksVisitor ===
56
+ if (typeof sourceCode.parserServices?.defineCustomBlocksVisitor ===
47
57
  "function" &&
48
58
  path_1.default.extname((0, compat_1.getFilename)(context)) === ".vue") {
49
- return sourceCode.parserServices.defineCustomBlocksVisitor(context, tomlESLintParser, {
59
+ return sourceCode.parserServices?.defineCustomBlocksVisitor(context, tomlESLintParser, {
50
60
  target: ["toml", "toml"],
51
61
  create(blockContext) {
52
62
  return rule.create(blockContext, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-toml",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "This ESLint plugin provides linting rules for TOML.",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "test:base": "mocha --require ts-node/register \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
22
22
  "test": "npm run test:base",
23
23
  "cover": "nyc --reporter=lcov npm run test:base",
24
- "test:debug": "mocha --require ts-node/register --inspect \"tests/src/**/*.ts\" --reporter dot",
24
+ "test:debug": "mocha --require ts-node/register/transpile-only --inspect \"tests/src/**/*.ts\" --reporter dot",
25
25
  "update": "node --require ts-node/register ./tools/update.ts && npm run eslint-fix",
26
26
  "new": "ts-node ./tools/new-rule.ts",
27
27
  "predocs:watch": "npm run build:ts",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "debug": "^4.1.1",
60
- "eslint-compat-utils": "^0.5.0",
60
+ "eslint-compat-utils": "^0.6.0",
61
61
  "lodash": "^4.17.19",
62
62
  "toml-eslint-parser": "^0.10.0"
63
63
  },
@@ -65,26 +65,27 @@
65
65
  "@changesets/changelog-github": "^0.5.0",
66
66
  "@changesets/cli": "^2.27.5",
67
67
  "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
68
- "@ota-meshi/eslint-plugin": "^0.17.4",
68
+ "@eslint/json": "^0.8.0",
69
+ "@ota-meshi/eslint-plugin": "^0.17.6",
69
70
  "@ota-meshi/site-kit-eslint-editor-vue": "^0.2.1",
70
71
  "@types/debug": "^4.1.12",
71
- "@types/eslint": "^8.56.10",
72
+ "@types/eslint": "^9.0.0",
72
73
  "@types/eslint-scope": "^3.7.7",
73
74
  "@types/eslint-visitor-keys": "^3.3.0",
74
75
  "@types/estree": "^1.0.5",
75
76
  "@types/lodash": "^4.17.5",
76
77
  "@types/mocha": "^10.0.7",
77
- "@types/node": "^20.14.8",
78
+ "@types/node": "^22.0.0",
78
79
  "@types/semver": "^7.5.8",
79
- "@typescript-eslint/eslint-plugin": "^7.13.1",
80
- "@typescript-eslint/parser": "^7.13.1",
80
+ "@typescript-eslint/eslint-plugin": "^8.16.0",
81
+ "@typescript-eslint/parser": "^8.16.0",
81
82
  "cross-env": "^7.0.3",
82
83
  "env-cmd": "^10.1.0",
83
- "esbuild": "^0.21.0",
84
+ "esbuild": "^0.24.0",
84
85
  "eslint": "^9.5.0",
85
86
  "eslint-config-prettier": "^9.1.0",
86
87
  "eslint-plugin-eslint-plugin": "^6.1.0",
87
- "eslint-plugin-jsdoc": "^48.2.15",
88
+ "eslint-plugin-jsdoc": "^50.0.0",
88
89
  "eslint-plugin-json-schema-validator": "^5.1.1",
89
90
  "eslint-plugin-jsonc": "^2.16.0",
90
91
  "eslint-plugin-markdown": "^5.0.0",
@@ -107,9 +108,9 @@
107
108
  "stylelint-config-standard-vue": "^1.0.0",
108
109
  "stylelint-stylus": "^1.0.0",
109
110
  "ts-node": "^10.9.2",
110
- "typescript": "~5.5.0",
111
- "typescript-eslint": "^7.13.1",
112
- "vite-plugin-eslint4b": "^0.4.6",
111
+ "typescript": "~5.7.0",
112
+ "typescript-eslint": "^8.16.0",
113
+ "vite-plugin-eslint4b": "^0.5.0",
113
114
  "vitepress": "^1.2.3",
114
115
  "vue-eslint-parser": "^9.4.3"
115
116
  },