@kazupon/eslint-config 0.9.1 → 0.10.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/README.md CHANGED
@@ -20,6 +20,7 @@ ESLint config for @kazupon
20
20
  - `jsonc`
21
21
  - `vue`,
22
22
  - `yml`
23
+ - `toml`
23
24
  - Support primitive eslint flat configuration
24
25
  - Support overrides for built-in configurations
25
26
  - `rules`
@@ -87,7 +88,7 @@ Add the following settings to your `.vscode/settings.json`:
87
88
  "source.fixAll.eslint": "explicit"
88
89
  },
89
90
  // Enable eslint for supported languages
90
- "eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5", "vue", "yaml"],
91
+ "eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5", "vue", "yaml", "toml"],
91
92
  // Enable flat configuration
92
93
  "eslint.useFlatConfig": true
93
94
  }
@@ -110,6 +111,7 @@ The following built-in configurations are supported:
110
111
  | `jsonc` | [`eslint-plugin-jsonc`](https://www.npmjs.com/package/eslint-plugin-jsonc) | yes |
111
112
  | `vue` | [`eslint-plugin-vue`](https://www.npmjs.com/package/eslint-plugin-vue) | yes |
112
113
  | `yml` | [`eslint-plugin-yml`](https://www.npmjs.com/package/eslint-plugin-yml) | yes |
114
+ | `toml` | [`eslint-plugin-toml`](https://www.npmjs.com/package/eslint-plugin-toml) | yes |
113
115
 
114
116
  You can use `import` syntax:
115
117
 
@@ -4,6 +4,7 @@ export * from './typescript';
4
4
  export * from './jsdoc';
5
5
  export * from './promise';
6
6
  export * from './regexp';
7
+ export * from './toml';
7
8
  export * from './unicorn';
8
9
  export * from './prettier';
9
10
  export * from './jsonc';
@@ -4,6 +4,7 @@ export * from './typescript';
4
4
  export * from './jsdoc';
5
5
  export * from './promise';
6
6
  export * from './regexp';
7
+ export * from './toml';
7
8
  export * from './unicorn';
8
9
  export * from './prettier';
9
10
  export * from './jsonc';
@@ -0,0 +1,15 @@
1
+ import type { Linter } from 'eslint';
2
+ import type { OverridesOptions, TomlRules } from '../types';
3
+ /**
4
+ * eslint toml configuration options
5
+ */
6
+ export interface TomlOptions {
7
+ }
8
+ /**
9
+ * `eslint-plugin-yml` and overrides configuration options
10
+ * @param {YmlOptions & OverridesOptions} options
11
+ * eslint yml configuration options for yml, yaml
12
+ * @returns {Promise<Linter.FlatConfig[]>}
13
+ * eslint flat configurations with `eslint-plugin-yml` and overrides
14
+ */
15
+ export declare function toml(options?: TomlOptions & OverridesOptions<TomlRules>): Promise<Linter.FlatConfig[]>;
@@ -0,0 +1,15 @@
1
+ import type { Linter } from 'eslint';
2
+ import type { OverridesOptions, TomlRules } from '../types';
3
+ /**
4
+ * eslint toml configuration options
5
+ */
6
+ export interface TomlOptions {
7
+ }
8
+ /**
9
+ * `eslint-plugin-yml` and overrides configuration options
10
+ * @param {YmlOptions & OverridesOptions} options
11
+ * eslint yml configuration options for yml, yaml
12
+ * @returns {Promise<Linter.FlatConfig[]>}
13
+ * eslint flat configurations with `eslint-plugin-yml` and overrides
14
+ */
15
+ export declare function toml(options?: TomlOptions & OverridesOptions<TomlRules>): Promise<Linter.FlatConfig[]>;
package/dist/globs.d.cts CHANGED
@@ -6,4 +6,5 @@ export declare const GLOB_JSON = "**/*.json";
6
6
  export declare const GLOB_JSON5 = "**/*.json5";
7
7
  export declare const GLOB_JSONC = "**/*.jsonc";
8
8
  export declare const GLOB_YAML = "**/*.y?(a)ml";
9
+ export declare const GLOB_TOML = "**/*.toml";
9
10
  export declare const GLOB_VUE = "**/*.vue";
package/dist/globs.d.ts CHANGED
@@ -6,4 +6,5 @@ export declare const GLOB_JSON = "**/*.json";
6
6
  export declare const GLOB_JSON5 = "**/*.json5";
7
7
  export declare const GLOB_JSONC = "**/*.jsonc";
8
8
  export declare const GLOB_YAML = "**/*.y?(a)ml";
9
+ export declare const GLOB_TOML = "**/*.toml";
9
10
  export declare const GLOB_VUE = "**/*.vue";
package/dist/index.cjs CHANGED
@@ -103,6 +103,7 @@ const GLOB_JSON = '**/*.json';
103
103
  const GLOB_JSON5 = '**/*.json5';
104
104
  const GLOB_JSONC = '**/*.jsonc';
105
105
  const GLOB_YAML = '**/*.y?(a)ml';
106
+ const GLOB_TOML = '**/*.toml';
106
107
  const GLOB_VUE = '**/*.vue';
107
108
 
108
109
  //#endregion
@@ -112,7 +113,7 @@ async function typescript(options = {}) {
112
113
  const ts = await loadPlugin('typescript-eslint');
113
114
  const files = options.files ?? [GLOB_TS, GLOB_TSX, ...extraFileExtensions.map((ext) => `**/*${ext}`)];
114
115
  return [...(ts.configs.recommendedTypeChecked), {
115
- files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML],
116
+ files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
116
117
  ...(ts.configs.disableTypeChecked)
117
118
  }, {
118
119
  name: '@kazupon/typescipt/typescript-eslint',
@@ -191,6 +192,27 @@ async function regexp(options = {}) {
191
192
  }];
192
193
  }
193
194
 
195
+ //#endregion
196
+ //#region src/configs/toml.ts
197
+ async function toml(options = {}) {
198
+ const { rules: overrideRules = {} } = options;
199
+ const toml$1 = await loadPlugin('eslint-plugin-toml');
200
+ const configs = [];
201
+ configs.push(...toml$1.configs['flat/standard'].map((config, index) => {
202
+ return config.name ? config : {
203
+ name: `toml/flat/standard/${index}`,
204
+ ...config
205
+ };
206
+ }));
207
+ const overriddenConfig = {
208
+ name: '@kazupon/toml',
209
+ files: [GLOB_TOML],
210
+ rules: {...overrideRules}
211
+ };
212
+ configs.push(overriddenConfig);
213
+ return configs;
214
+ }
215
+
194
216
  //#endregion
195
217
  //#region src/configs/unicorn.ts
196
218
  async function unicorn(options = {}) {
@@ -342,6 +364,7 @@ exports.jsonc = jsonc;
342
364
  exports.prettier = prettier;
343
365
  exports.promise = promise;
344
366
  exports.regexp = regexp;
367
+ exports.toml = toml;
345
368
  exports.typescript = typescript;
346
369
  exports.unicorn = unicorn;
347
370
  exports.vue = vue;
package/dist/index.js CHANGED
@@ -78,6 +78,7 @@ const GLOB_JSON = '**/*.json';
78
78
  const GLOB_JSON5 = '**/*.json5';
79
79
  const GLOB_JSONC = '**/*.jsonc';
80
80
  const GLOB_YAML = '**/*.y?(a)ml';
81
+ const GLOB_TOML = '**/*.toml';
81
82
  const GLOB_VUE = '**/*.vue';
82
83
 
83
84
  //#endregion
@@ -87,7 +88,7 @@ async function typescript(options = {}) {
87
88
  const ts = await loadPlugin('typescript-eslint');
88
89
  const files = options.files ?? [GLOB_TS, GLOB_TSX, ...extraFileExtensions.map((ext) => `**/*${ext}`)];
89
90
  return [...(ts.configs.recommendedTypeChecked), {
90
- files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML],
91
+ files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
91
92
  ...(ts.configs.disableTypeChecked)
92
93
  }, {
93
94
  name: '@kazupon/typescipt/typescript-eslint',
@@ -166,6 +167,27 @@ async function regexp(options = {}) {
166
167
  }];
167
168
  }
168
169
 
170
+ //#endregion
171
+ //#region src/configs/toml.ts
172
+ async function toml(options = {}) {
173
+ const { rules: overrideRules = {} } = options;
174
+ const toml$1 = await loadPlugin('eslint-plugin-toml');
175
+ const configs = [];
176
+ configs.push(...toml$1.configs['flat/standard'].map((config, index) => {
177
+ return config.name ? config : {
178
+ name: `toml/flat/standard/${index}`,
179
+ ...config
180
+ };
181
+ }));
182
+ const overriddenConfig = {
183
+ name: '@kazupon/toml',
184
+ files: [GLOB_TOML],
185
+ rules: {...overrideRules}
186
+ };
187
+ configs.push(overriddenConfig);
188
+ return configs;
189
+ }
190
+
169
191
  //#endregion
170
192
  //#region src/configs/unicorn.ts
171
193
  async function unicorn(options = {}) {
@@ -308,4 +330,4 @@ async function vue(options = {}) {
308
330
  }
309
331
 
310
332
  //#endregion
311
- export { comments, defineConfig, javascript, jsdoc, jsonc, prettier, promise, regexp, typescript, unicorn, vue, yaml, yml };
333
+ export { comments, defineConfig, javascript, jsdoc, jsonc, prettier, promise, regexp, toml, typescript, unicorn, vue, yaml, yml };
@@ -5,13 +5,14 @@ import type { JsoncRules } from './jsonc';
5
5
  import type { PrettierRules } from './prettier';
6
6
  import type { PromiseRules } from './promise';
7
7
  import type { RegexpRules } from './regexp';
8
+ import type { TomlRules } from './toml';
8
9
  import type { TypescriptRules } from './typescript';
9
10
  import type { UnicornRules } from './unicorn';
10
11
  import type { VueRules } from './vue';
11
12
  import type { YmlRules } from './yml';
12
13
  declare module 'eslint' {
13
14
  namespace Linter {
14
- interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
+ interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TomlRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
16
  }
16
17
  }
17
18
  }
@@ -5,13 +5,14 @@ import type { JsoncRules } from './jsonc';
5
5
  import type { PrettierRules } from './prettier';
6
6
  import type { PromiseRules } from './promise';
7
7
  import type { RegexpRules } from './regexp';
8
+ import type { TomlRules } from './toml';
8
9
  import type { TypescriptRules } from './typescript';
9
10
  import type { UnicornRules } from './unicorn';
10
11
  import type { VueRules } from './vue';
11
12
  import type { YmlRules } from './yml';
12
13
  declare module 'eslint' {
13
14
  namespace Linter {
14
- interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
+ interface RulesRecord extends CommentsRules, JavascriptRules, JsdocRules, JsoncRules, PrettierRules, PromiseRules, RegexpRules, TomlRules, TypescriptRules, UnicornRules, VueRules, YmlRules {
15
16
  }
16
17
  }
17
18
  }
@@ -0,0 +1,256 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface TomlRules {
3
+ /**
4
+ * enforce linebreaks after opening and before closing array brackets
5
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-bracket-newline.html
6
+ */
7
+ 'toml/array-bracket-newline'?: Linter.RuleEntry<TomlArrayBracketNewline>;
8
+ /**
9
+ * enforce consistent spacing inside array brackets
10
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-bracket-spacing.html
11
+ */
12
+ 'toml/array-bracket-spacing'?: Linter.RuleEntry<TomlArrayBracketSpacing>;
13
+ /**
14
+ * enforce line breaks between array elements
15
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-element-newline.html
16
+ */
17
+ 'toml/array-element-newline'?: Linter.RuleEntry<TomlArrayElementNewline>;
18
+ /**
19
+ * enforce consistent comma style in array
20
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/comma-style.html
21
+ */
22
+ 'toml/comma-style'?: Linter.RuleEntry<TomlCommaStyle>;
23
+ /**
24
+ * enforce consistent indentation
25
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/indent.html
26
+ */
27
+ 'toml/indent'?: Linter.RuleEntry<TomlIndent>;
28
+ /**
29
+ * enforce consistent spacing inside braces
30
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-spacing.html
31
+ */
32
+ 'toml/inline-table-curly-spacing'?: Linter.RuleEntry<TomlInlineTableCurlySpacing>;
33
+ /**
34
+ * enforce consistent spacing between keys and values in key/value pairs
35
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/key-spacing.html
36
+ */
37
+ 'toml/key-spacing'?: Linter.RuleEntry<TomlKeySpacing>;
38
+ /**
39
+ * disallow defining pair keys out-of-order
40
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/keys-order.html
41
+ */
42
+ 'toml/keys-order'?: Linter.RuleEntry<[]>;
43
+ /**
44
+ * disallow mixed data types in array
45
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-mixed-type-in-array.html
46
+ */
47
+ 'toml/no-mixed-type-in-array'?: Linter.RuleEntry<TomlNoMixedTypeInArray>;
48
+ /**
49
+ * disallow hexadecimal, octal and binary integer
50
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-non-decimal-integer.html
51
+ */
52
+ 'toml/no-non-decimal-integer'?: Linter.RuleEntry<TomlNoNonDecimalInteger>;
53
+ /**
54
+ * disallow spacing around infix operators
55
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-space-dots.html
56
+ */
57
+ 'toml/no-space-dots'?: Linter.RuleEntry<[]>;
58
+ /**
59
+ * disallow number separators that to not enhance readability.
60
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-unreadable-number-separator.html
61
+ */
62
+ 'toml/no-unreadable-number-separator'?: Linter.RuleEntry<[]>;
63
+ /**
64
+ * require or disallow padding lines between pairs
65
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/padding-line-between-pairs.html
66
+ */
67
+ 'toml/padding-line-between-pairs'?: Linter.RuleEntry<[]>;
68
+ /**
69
+ * require or disallow padding lines between tables
70
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/padding-line-between-tables.html
71
+ */
72
+ 'toml/padding-line-between-tables'?: Linter.RuleEntry<[]>;
73
+ /**
74
+ * disallow precision of fractional seconds greater than the specified value.
75
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/precision-of-fractional-seconds.html
76
+ */
77
+ 'toml/precision-of-fractional-seconds'?: Linter.RuleEntry<TomlPrecisionOfFractionalSeconds>;
78
+ /**
79
+ * disallow precision of integer greater than the specified value.
80
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/precision-of-integer.html
81
+ */
82
+ 'toml/precision-of-integer'?: Linter.RuleEntry<TomlPrecisionOfInteger>;
83
+ /**
84
+ * require or disallow quotes around keys
85
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/quoted-keys.html
86
+ */
87
+ 'toml/quoted-keys'?: Linter.RuleEntry<TomlQuotedKeys>;
88
+ /**
89
+ * require spacing around equals sign
90
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/space-eq-sign.html
91
+ * @deprecated
92
+ */
93
+ 'toml/space-eq-sign'?: Linter.RuleEntry<[]>;
94
+ /**
95
+ * enforce consistent spacing after the `#` in a comment
96
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/spaced-comment.html
97
+ */
98
+ 'toml/spaced-comment'?: Linter.RuleEntry<TomlSpacedComment>;
99
+ /**
100
+ * enforce consistent spacing inside table brackets
101
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/table-bracket-spacing.html
102
+ */
103
+ 'toml/table-bracket-spacing'?: Linter.RuleEntry<TomlTableBracketSpacing>;
104
+ /**
105
+ * disallow defining tables out-of-order
106
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/tables-order.html
107
+ */
108
+ 'toml/tables-order'?: Linter.RuleEntry<[]>;
109
+ /**
110
+ * disallow parsing errors in Vue custom blocks
111
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/vue-custom-block/no-parsing-error.html
112
+ */
113
+ 'toml/vue-custom-block/no-parsing-error'?: Linter.RuleEntry<[]>;
114
+ }
115
+ type TomlArrayBracketNewline = [] | [
116
+ (("always" | "never" | "consistent") | {
117
+ multiline?: boolean;
118
+ minItems?: (number | null);
119
+ })
120
+ ];
121
+ type TomlArrayBracketSpacing = [] | [("always" | "never")] | [
122
+ ("always" | "never"),
123
+ {
124
+ singleValue?: boolean;
125
+ objectsInArrays?: boolean;
126
+ arraysInArrays?: boolean;
127
+ }
128
+ ];
129
+ type TomlArrayElementNewline = [] | [
130
+ (_TomlArrayElementNewlineBasicConfig | {
131
+ ArrayExpression?: _TomlArrayElementNewlineBasicConfig;
132
+ ArrayPattern?: _TomlArrayElementNewlineBasicConfig;
133
+ TOMLArray?: _TomlArrayElementNewlineBasicConfig;
134
+ })
135
+ ];
136
+ type _TomlArrayElementNewlineBasicConfig = (("always" | "never" | "consistent") | {
137
+ multiline?: boolean;
138
+ minItems?: (number | null);
139
+ });
140
+ type TomlCommaStyle = [] | [("first" | "last")] | [
141
+ ("first" | "last"),
142
+ {
143
+ exceptions?: {
144
+ [k: string]: boolean | undefined;
145
+ };
146
+ }
147
+ ];
148
+ type TomlIndent = [] | [("tab" | number)] | [
149
+ ("tab" | number),
150
+ {
151
+ subTables?: number;
152
+ keyValuePairs?: number;
153
+ }
154
+ ];
155
+ type TomlInlineTableCurlySpacing = [] | [("always" | "never")] | [
156
+ ("always" | "never"),
157
+ {
158
+ arraysInObjects?: boolean;
159
+ objectsInObjects?: boolean;
160
+ }
161
+ ];
162
+ type TomlKeySpacing = [] | [
163
+ ({
164
+ align?: (("equal" | "value") | {
165
+ on?: ("equal" | "value");
166
+ mode?: ("strict" | "minimum");
167
+ beforeEqual?: boolean;
168
+ afterEqual?: boolean;
169
+ });
170
+ mode?: ("strict" | "minimum");
171
+ beforeEqual?: boolean;
172
+ afterEqual?: boolean;
173
+ } | {
174
+ singleLine?: {
175
+ mode?: ("strict" | "minimum");
176
+ beforeEqual?: boolean;
177
+ afterEqual?: boolean;
178
+ };
179
+ multiLine?: {
180
+ align?: (("equal" | "value") | {
181
+ on?: ("equal" | "value");
182
+ mode?: ("strict" | "minimum");
183
+ beforeEqual?: boolean;
184
+ afterEqual?: boolean;
185
+ });
186
+ mode?: ("strict" | "minimum");
187
+ beforeEqual?: boolean;
188
+ afterEqual?: boolean;
189
+ };
190
+ } | {
191
+ singleLine?: {
192
+ mode?: ("strict" | "minimum");
193
+ beforeEqual?: boolean;
194
+ afterEqual?: boolean;
195
+ };
196
+ multiLine?: {
197
+ mode?: ("strict" | "minimum");
198
+ beforeEqual?: boolean;
199
+ afterEqual?: boolean;
200
+ };
201
+ align?: {
202
+ on?: ("equal" | "value");
203
+ mode?: ("strict" | "minimum");
204
+ beforeEqual?: boolean;
205
+ afterEqual?: boolean;
206
+ };
207
+ })
208
+ ];
209
+ type TomlNoMixedTypeInArray = [] | [
210
+ {
211
+ typeMap?: {
212
+ string?: string;
213
+ boolean?: string;
214
+ integer?: string;
215
+ float?: string;
216
+ offsetDateTime?: string;
217
+ localDateTime?: string;
218
+ localDate?: string;
219
+ localTime?: string;
220
+ array?: string;
221
+ inlineTable?: string;
222
+ };
223
+ }
224
+ ];
225
+ type TomlNoNonDecimalInteger = [] | [
226
+ {
227
+ allowHexadecimal?: boolean;
228
+ allowOctal?: boolean;
229
+ allowBinary?: boolean;
230
+ }
231
+ ];
232
+ type TomlPrecisionOfFractionalSeconds = [] | [
233
+ {
234
+ max?: number;
235
+ }
236
+ ];
237
+ type TomlPrecisionOfInteger = [] | [
238
+ {
239
+ maxBit?: number;
240
+ }
241
+ ];
242
+ type TomlQuotedKeys = [] | [
243
+ {
244
+ prefer?: ("as-needed" | "always");
245
+ numbers?: boolean;
246
+ }
247
+ ];
248
+ type TomlSpacedComment = [] | [("always" | "never")] | [
249
+ ("always" | "never"),
250
+ {
251
+ exceptions?: string[];
252
+ markers?: string[];
253
+ }
254
+ ];
255
+ type TomlTableBracketSpacing = [] | [("always" | "never")];
256
+ export {};
@@ -0,0 +1,256 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface TomlRules {
3
+ /**
4
+ * enforce linebreaks after opening and before closing array brackets
5
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-bracket-newline.html
6
+ */
7
+ 'toml/array-bracket-newline'?: Linter.RuleEntry<TomlArrayBracketNewline>;
8
+ /**
9
+ * enforce consistent spacing inside array brackets
10
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-bracket-spacing.html
11
+ */
12
+ 'toml/array-bracket-spacing'?: Linter.RuleEntry<TomlArrayBracketSpacing>;
13
+ /**
14
+ * enforce line breaks between array elements
15
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/array-element-newline.html
16
+ */
17
+ 'toml/array-element-newline'?: Linter.RuleEntry<TomlArrayElementNewline>;
18
+ /**
19
+ * enforce consistent comma style in array
20
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/comma-style.html
21
+ */
22
+ 'toml/comma-style'?: Linter.RuleEntry<TomlCommaStyle>;
23
+ /**
24
+ * enforce consistent indentation
25
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/indent.html
26
+ */
27
+ 'toml/indent'?: Linter.RuleEntry<TomlIndent>;
28
+ /**
29
+ * enforce consistent spacing inside braces
30
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-spacing.html
31
+ */
32
+ 'toml/inline-table-curly-spacing'?: Linter.RuleEntry<TomlInlineTableCurlySpacing>;
33
+ /**
34
+ * enforce consistent spacing between keys and values in key/value pairs
35
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/key-spacing.html
36
+ */
37
+ 'toml/key-spacing'?: Linter.RuleEntry<TomlKeySpacing>;
38
+ /**
39
+ * disallow defining pair keys out-of-order
40
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/keys-order.html
41
+ */
42
+ 'toml/keys-order'?: Linter.RuleEntry<[]>;
43
+ /**
44
+ * disallow mixed data types in array
45
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-mixed-type-in-array.html
46
+ */
47
+ 'toml/no-mixed-type-in-array'?: Linter.RuleEntry<TomlNoMixedTypeInArray>;
48
+ /**
49
+ * disallow hexadecimal, octal and binary integer
50
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-non-decimal-integer.html
51
+ */
52
+ 'toml/no-non-decimal-integer'?: Linter.RuleEntry<TomlNoNonDecimalInteger>;
53
+ /**
54
+ * disallow spacing around infix operators
55
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-space-dots.html
56
+ */
57
+ 'toml/no-space-dots'?: Linter.RuleEntry<[]>;
58
+ /**
59
+ * disallow number separators that to not enhance readability.
60
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/no-unreadable-number-separator.html
61
+ */
62
+ 'toml/no-unreadable-number-separator'?: Linter.RuleEntry<[]>;
63
+ /**
64
+ * require or disallow padding lines between pairs
65
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/padding-line-between-pairs.html
66
+ */
67
+ 'toml/padding-line-between-pairs'?: Linter.RuleEntry<[]>;
68
+ /**
69
+ * require or disallow padding lines between tables
70
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/padding-line-between-tables.html
71
+ */
72
+ 'toml/padding-line-between-tables'?: Linter.RuleEntry<[]>;
73
+ /**
74
+ * disallow precision of fractional seconds greater than the specified value.
75
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/precision-of-fractional-seconds.html
76
+ */
77
+ 'toml/precision-of-fractional-seconds'?: Linter.RuleEntry<TomlPrecisionOfFractionalSeconds>;
78
+ /**
79
+ * disallow precision of integer greater than the specified value.
80
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/precision-of-integer.html
81
+ */
82
+ 'toml/precision-of-integer'?: Linter.RuleEntry<TomlPrecisionOfInteger>;
83
+ /**
84
+ * require or disallow quotes around keys
85
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/quoted-keys.html
86
+ */
87
+ 'toml/quoted-keys'?: Linter.RuleEntry<TomlQuotedKeys>;
88
+ /**
89
+ * require spacing around equals sign
90
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/space-eq-sign.html
91
+ * @deprecated
92
+ */
93
+ 'toml/space-eq-sign'?: Linter.RuleEntry<[]>;
94
+ /**
95
+ * enforce consistent spacing after the `#` in a comment
96
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/spaced-comment.html
97
+ */
98
+ 'toml/spaced-comment'?: Linter.RuleEntry<TomlSpacedComment>;
99
+ /**
100
+ * enforce consistent spacing inside table brackets
101
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/table-bracket-spacing.html
102
+ */
103
+ 'toml/table-bracket-spacing'?: Linter.RuleEntry<TomlTableBracketSpacing>;
104
+ /**
105
+ * disallow defining tables out-of-order
106
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/tables-order.html
107
+ */
108
+ 'toml/tables-order'?: Linter.RuleEntry<[]>;
109
+ /**
110
+ * disallow parsing errors in Vue custom blocks
111
+ * @see https://ota-meshi.github.io/eslint-plugin-toml/rules/vue-custom-block/no-parsing-error.html
112
+ */
113
+ 'toml/vue-custom-block/no-parsing-error'?: Linter.RuleEntry<[]>;
114
+ }
115
+ type TomlArrayBracketNewline = [] | [
116
+ (("always" | "never" | "consistent") | {
117
+ multiline?: boolean;
118
+ minItems?: (number | null);
119
+ })
120
+ ];
121
+ type TomlArrayBracketSpacing = [] | [("always" | "never")] | [
122
+ ("always" | "never"),
123
+ {
124
+ singleValue?: boolean;
125
+ objectsInArrays?: boolean;
126
+ arraysInArrays?: boolean;
127
+ }
128
+ ];
129
+ type TomlArrayElementNewline = [] | [
130
+ (_TomlArrayElementNewlineBasicConfig | {
131
+ ArrayExpression?: _TomlArrayElementNewlineBasicConfig;
132
+ ArrayPattern?: _TomlArrayElementNewlineBasicConfig;
133
+ TOMLArray?: _TomlArrayElementNewlineBasicConfig;
134
+ })
135
+ ];
136
+ type _TomlArrayElementNewlineBasicConfig = (("always" | "never" | "consistent") | {
137
+ multiline?: boolean;
138
+ minItems?: (number | null);
139
+ });
140
+ type TomlCommaStyle = [] | [("first" | "last")] | [
141
+ ("first" | "last"),
142
+ {
143
+ exceptions?: {
144
+ [k: string]: boolean | undefined;
145
+ };
146
+ }
147
+ ];
148
+ type TomlIndent = [] | [("tab" | number)] | [
149
+ ("tab" | number),
150
+ {
151
+ subTables?: number;
152
+ keyValuePairs?: number;
153
+ }
154
+ ];
155
+ type TomlInlineTableCurlySpacing = [] | [("always" | "never")] | [
156
+ ("always" | "never"),
157
+ {
158
+ arraysInObjects?: boolean;
159
+ objectsInObjects?: boolean;
160
+ }
161
+ ];
162
+ type TomlKeySpacing = [] | [
163
+ ({
164
+ align?: (("equal" | "value") | {
165
+ on?: ("equal" | "value");
166
+ mode?: ("strict" | "minimum");
167
+ beforeEqual?: boolean;
168
+ afterEqual?: boolean;
169
+ });
170
+ mode?: ("strict" | "minimum");
171
+ beforeEqual?: boolean;
172
+ afterEqual?: boolean;
173
+ } | {
174
+ singleLine?: {
175
+ mode?: ("strict" | "minimum");
176
+ beforeEqual?: boolean;
177
+ afterEqual?: boolean;
178
+ };
179
+ multiLine?: {
180
+ align?: (("equal" | "value") | {
181
+ on?: ("equal" | "value");
182
+ mode?: ("strict" | "minimum");
183
+ beforeEqual?: boolean;
184
+ afterEqual?: boolean;
185
+ });
186
+ mode?: ("strict" | "minimum");
187
+ beforeEqual?: boolean;
188
+ afterEqual?: boolean;
189
+ };
190
+ } | {
191
+ singleLine?: {
192
+ mode?: ("strict" | "minimum");
193
+ beforeEqual?: boolean;
194
+ afterEqual?: boolean;
195
+ };
196
+ multiLine?: {
197
+ mode?: ("strict" | "minimum");
198
+ beforeEqual?: boolean;
199
+ afterEqual?: boolean;
200
+ };
201
+ align?: {
202
+ on?: ("equal" | "value");
203
+ mode?: ("strict" | "minimum");
204
+ beforeEqual?: boolean;
205
+ afterEqual?: boolean;
206
+ };
207
+ })
208
+ ];
209
+ type TomlNoMixedTypeInArray = [] | [
210
+ {
211
+ typeMap?: {
212
+ string?: string;
213
+ boolean?: string;
214
+ integer?: string;
215
+ float?: string;
216
+ offsetDateTime?: string;
217
+ localDateTime?: string;
218
+ localDate?: string;
219
+ localTime?: string;
220
+ array?: string;
221
+ inlineTable?: string;
222
+ };
223
+ }
224
+ ];
225
+ type TomlNoNonDecimalInteger = [] | [
226
+ {
227
+ allowHexadecimal?: boolean;
228
+ allowOctal?: boolean;
229
+ allowBinary?: boolean;
230
+ }
231
+ ];
232
+ type TomlPrecisionOfFractionalSeconds = [] | [
233
+ {
234
+ max?: number;
235
+ }
236
+ ];
237
+ type TomlPrecisionOfInteger = [] | [
238
+ {
239
+ maxBit?: number;
240
+ }
241
+ ];
242
+ type TomlQuotedKeys = [] | [
243
+ {
244
+ prefer?: ("as-needed" | "always");
245
+ numbers?: boolean;
246
+ }
247
+ ];
248
+ type TomlSpacedComment = [] | [("always" | "never")] | [
249
+ ("always" | "never"),
250
+ {
251
+ exceptions?: string[];
252
+ markers?: string[];
253
+ }
254
+ ];
255
+ type TomlTableBracketSpacing = [] | [("always" | "never")];
256
+ export {};
@@ -11,4 +11,5 @@ export * from './gens/regexp';
11
11
  export * from './gens/typescript';
12
12
  export * from './gens/vue';
13
13
  export * from './gens/yml';
14
+ export * from './gens/toml';
14
15
  export * from './gens/eslint';
@@ -11,4 +11,5 @@ export * from './gens/regexp';
11
11
  export * from './gens/typescript';
12
12
  export * from './gens/vue';
13
13
  export * from './gens/yml';
14
+ export * from './gens/toml';
14
15
  export * from './gens/eslint';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-config",
3
3
  "description": "ESLint config for @kazupon",
4
- "version": "0.9.1",
4
+ "version": "0.10.0",
5
5
  "author": {
6
6
  "email": "kawakazu80@gmail.com",
7
7
  "name": "kazuya kawaguchi"
@@ -52,6 +52,7 @@
52
52
  "eslint-plugin-jsonc": ">=2.16.0",
53
53
  "eslint-plugin-promise": ">=6.4.0",
54
54
  "eslint-plugin-regexp": ">=2.6.0",
55
+ "eslint-plugin-toml": ">=0.11.0",
55
56
  "eslint-plugin-unicorn": ">=54.0.0",
56
57
  "eslint-plugin-vue": ">=9.24.0",
57
58
  "eslint-plugin-yml": ">=1.14.0",
@@ -73,6 +74,9 @@
73
74
  "eslint-plugin-regexp": {
74
75
  "optional": true
75
76
  },
77
+ "eslint-plugin-toml": {
78
+ "optional": true
79
+ },
76
80
  "eslint-plugin-unicorn": {
77
81
  "optional": true
78
82
  },
@@ -97,6 +101,7 @@
97
101
  "eslint-plugin-jsonc": "^2.16.0",
98
102
  "eslint-plugin-promise": "^6.4.0",
99
103
  "eslint-plugin-regexp": "^2.6.0",
104
+ "eslint-plugin-toml": "^0.11.0",
100
105
  "eslint-plugin-unicorn": "^54.0.0",
101
106
  "eslint-plugin-vue": "^9.27.0",
102
107
  "eslint-plugin-yml": "^1.14.0",