eslint-plugin-svelte 3.9.1 → 3.9.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.
package/lib/main.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare const configs: {
14
14
  export declare const rules: Record<string, Rule.RuleModule>;
15
15
  export declare const meta: {
16
16
  name: "eslint-plugin-svelte";
17
- version: "3.9.1";
17
+ version: "3.9.2";
18
18
  };
19
19
  export declare const processors: {
20
20
  '.svelte': typeof processor;
package/lib/meta.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export declare const name: "eslint-plugin-svelte";
2
- export declare const version: "3.9.1";
2
+ export declare const version: "3.9.2";
package/lib/meta.js CHANGED
@@ -2,4 +2,4 @@
2
2
  // This file has been automatically generated,
3
3
  // in order to update its content execute "pnpm run update"
4
4
  export const name = 'eslint-plugin-svelte';
5
- export const version = '3.9.1';
5
+ export const version = '3.9.2';
@@ -12,7 +12,6 @@ import { extractLeadingComments } from './extract-leading-comments.js';
12
12
  import { findAttribute, getLangValue } from '../../utils/ast-utils.js';
13
13
  import path from 'path';
14
14
  import fs from 'fs';
15
- import semver from 'semver';
16
15
  const STYLE_TRANSFORMS = {
17
16
  postcss: transformWithPostCSS,
18
17
  pcss: transformWithPostCSS,
@@ -277,7 +276,7 @@ function* transformScripts(context, text) {
277
276
  }
278
277
  }
279
278
  }
280
- function hasTagOption(program) {
279
+ function isCustomElement(program) {
281
280
  return program.body.some((body) => {
282
281
  if (body.type !== 'SvelteElement' || body.kind !== 'special') {
283
282
  return false;
@@ -285,7 +284,7 @@ function hasTagOption(program) {
285
284
  if (body.name.name !== 'svelte:options') {
286
285
  return false;
287
286
  }
288
- return Boolean(findAttribute(body, 'tag'));
287
+ return Boolean(findAttribute(body, 'tag')) || Boolean(findAttribute(body, 'customElement'));
289
288
  });
290
289
  }
291
290
  /**
@@ -295,11 +294,7 @@ function getWarningsFromCode(code, context) {
295
294
  try {
296
295
  const result = compiler.compile(code, {
297
296
  generate: false,
298
- ...(semver.satisfies(compiler.VERSION, '>=4.0.0-0')
299
- ? { customElement: true }
300
- : hasTagOption(context.sourceCode.ast)
301
- ? { customElement: true }
302
- : {})
297
+ ...(isCustomElement(context.sourceCode.ast) ? { customElement: true } : {})
303
298
  });
304
299
  return { warnings: result.warnings, kind: 'warn' };
305
300
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-svelte",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "description": "ESLint plugin for Svelte using AST",
5
5
  "repository": "git+https://github.com/sveltejs/eslint-plugin-svelte.git",
6
6
  "homepage": "https://sveltejs.github.io/eslint-plugin-svelte",