rulint 1.1.1 → 1.1.2

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.
Files changed (3) hide show
  1. package/dist/main.js +17 -19
  2. package/dist/main.mjs +17 -19
  3. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -213,25 +213,23 @@ var rulint = (options = RulintOptionsDefault) => {
213
213
  options = (0, import_lodash.default)({}, RulintOptionsDefault, options);
214
214
  if (options.append?.["no-restricted-imports"] && typeof options.js?.rules?.["no-restricted-imports"] === "object") options.js.rules["no-restricted-imports"] = [...options.js.rules["no-restricted-imports"], ...options.append["no-restricted-imports"]];
215
215
  if (options.append?.["no-restricted-syntax"] && typeof options.js?.rules?.["no-restricted-syntax"] === "object") options.js.rules["no-restricted-syntax"] = [...options.js.rules["no-restricted-syntax"], ...options.append["no-restricted-syntax"]];
216
- if (options.enabled === true) {
217
- return [
218
- { ignores: options.ignores },
219
- import_eslint_plugin_zod.default.configs.recommended,
220
- {
221
- files: options.js?.files,
222
- languageOptions: options.js?.languageOptions,
223
- plugins: options.js?.plugins,
224
- rules: options.js?.rules
225
- },
226
- {
227
- files: options.ts?.files,
228
- languageOptions: options.ts?.languageOptions,
229
- plugins: options.ts?.plugins,
230
- rules: options.ts?.rules
231
- },
232
- ...options.configs ?? []
233
- ];
234
- } else return [{ ignores: options.ignores }, ...options.configs ?? []];
216
+ return [
217
+ { ignores: options.ignores },
218
+ ...options.enabled === true ? [import_eslint_plugin_zod.default.configs.recommended] : [],
219
+ {
220
+ files: options.js?.files,
221
+ languageOptions: options.js?.languageOptions,
222
+ plugins: options.js?.plugins,
223
+ rules: options.enabled === true ? options.js?.rules : {}
224
+ },
225
+ {
226
+ files: options.ts?.files,
227
+ languageOptions: options.ts?.languageOptions,
228
+ plugins: options.ts?.plugins,
229
+ rules: options.enabled === true ? options.ts?.rules : {}
230
+ },
231
+ ...options.configs ?? []
232
+ ];
235
233
  };
236
234
  // Annotate the CommonJS export names for ESM import in node:
237
235
  0 && (module.exports = {
package/dist/main.mjs CHANGED
@@ -177,25 +177,23 @@ var rulint = (options = RulintOptionsDefault) => {
177
177
  options = merge({}, RulintOptionsDefault, options);
178
178
  if (options.append?.["no-restricted-imports"] && typeof options.js?.rules?.["no-restricted-imports"] === "object") options.js.rules["no-restricted-imports"] = [...options.js.rules["no-restricted-imports"], ...options.append["no-restricted-imports"]];
179
179
  if (options.append?.["no-restricted-syntax"] && typeof options.js?.rules?.["no-restricted-syntax"] === "object") options.js.rules["no-restricted-syntax"] = [...options.js.rules["no-restricted-syntax"], ...options.append["no-restricted-syntax"]];
180
- if (options.enabled === true) {
181
- return [
182
- { ignores: options.ignores },
183
- EslintPluginZod.configs.recommended,
184
- {
185
- files: options.js?.files,
186
- languageOptions: options.js?.languageOptions,
187
- plugins: options.js?.plugins,
188
- rules: options.js?.rules
189
- },
190
- {
191
- files: options.ts?.files,
192
- languageOptions: options.ts?.languageOptions,
193
- plugins: options.ts?.plugins,
194
- rules: options.ts?.rules
195
- },
196
- ...options.configs ?? []
197
- ];
198
- } else return [{ ignores: options.ignores }, ...options.configs ?? []];
180
+ return [
181
+ { ignores: options.ignores },
182
+ ...options.enabled === true ? [EslintPluginZod.configs.recommended] : [],
183
+ {
184
+ files: options.js?.files,
185
+ languageOptions: options.js?.languageOptions,
186
+ plugins: options.js?.plugins,
187
+ rules: options.enabled === true ? options.js?.rules : {}
188
+ },
189
+ {
190
+ files: options.ts?.files,
191
+ languageOptions: options.ts?.languageOptions,
192
+ plugins: options.ts?.plugins,
193
+ rules: options.enabled === true ? options.ts?.rules : {}
194
+ },
195
+ ...options.configs ?? []
196
+ ];
199
197
  };
200
198
  export {
201
199
  rulint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulint",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Strict ESLint presets for modern TypeScript projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/rulint",