Socket
Socket
Sign inDemoInstall

eslint-plugin-svelte

Package Overview
Dependencies
Maintainers
0
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-svelte - npm Package Compare versions

Comparing version 2.40.0 to 2.41.0

8

lib/configs/all.d.ts

@@ -1,5 +0,3 @@

declare const _default: {
extends: string[];
rules: any;
};
export = _default;
import type { Linter } from 'eslint';
declare const config: Linter.Config;
export = config;

@@ -5,7 +5,7 @@ "use strict";

};
const path_1 = __importDefault(require("path"));
const node_path_1 = __importDefault(require("node:path"));
const rules_1 = require("../utils/rules");
const base = require.resolve('./base');
const baseExtend = path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
module.exports = {
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
const config = {
extends: [baseExtend],

@@ -19,1 +19,2 @@ rules: Object.fromEntries(rules_1.rules

};
module.exports = config;

@@ -1,14 +0,3 @@

declare const _default: {
plugins: string[];
overrides: {
files: string[];
parser: string;
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
}[];
};
export = _default;
import type { Linter } from 'eslint';
declare const config: Linter.Config;
export = config;
"use strict";
module.exports = {
const config = {
plugins: ['svelte'],

@@ -21,1 +21,2 @@ overrides: [

};
module.exports = config;

@@ -1,25 +0,3 @@

declare const _default: ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: any;
})[];
export default _default;
import type { Linter } from 'eslint';
declare const config: Linter.FlatConfig[];
export default config;

@@ -8,5 +8,6 @@ "use strict";

const base_1 = __importDefault(require("./base"));
exports.default = [
const config = [
...base_1.default,
{
name: 'svelte:all:rules',
rules: Object.fromEntries(rules_1.rules

@@ -20,1 +21,2 @@ .map((rule) => [`svelte/${rule.meta.docs.ruleName}`, 'error'])

];
exports.default = config;

@@ -1,24 +0,3 @@

import type { ESLint } from 'eslint';
declare const _default: ({
plugins: {
readonly svelte: ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
})[];
export default _default;
import type { Linter } from 'eslint';
declare const config: Linter.FlatConfig[];
export default config;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = [
const config = [
{
name: 'svelte:base:setup-plugin',
plugins: {

@@ -13,2 +14,3 @@ get svelte() {

{
name: 'svelte:base:setup-for-svelte',
files: ['*.svelte', '**/*.svelte'],

@@ -32,1 +34,2 @@ languageOptions: {

];
exports.default = config;

@@ -1,37 +0,3 @@

declare const _default: ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: {
'svelte/first-attribute-linebreak': string;
'svelte/html-closing-bracket-spacing': string;
'svelte/html-quotes': string;
'svelte/html-self-closing': string;
'svelte/indent': string;
'svelte/max-attributes-per-line': string;
'svelte/mustache-spacing': string;
'svelte/no-spaces-around-equal-signs-in-attribute': string;
'svelte/no-trailing-spaces': string;
'svelte/shorthand-attribute': string;
'svelte/shorthand-directive': string;
};
})[];
export default _default;
import type { Linter } from 'eslint';
declare const config: Linter.FlatConfig[];
export default config;

@@ -6,9 +6,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "pnpm run update"
const base_1 = __importDefault(require("./base"));
exports.default = [
const config = [
...base_1.default,
{
name: 'svelte:prettier:turn-off-rules',
rules: {

@@ -30,1 +28,2 @@ // eslint-plugin-svelte rules

];
exports.default = config;

@@ -1,40 +0,3 @@

declare const _default: ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: {
'svelte/comment-directive': string;
'svelte/no-at-debug-tags': string;
'svelte/no-at-html-tags': string;
'svelte/no-dupe-else-if-blocks': string;
'svelte/no-dupe-style-properties': string;
'svelte/no-dynamic-slot-name': string;
'svelte/no-inner-declarations': string;
'svelte/no-not-function-handler': string;
'svelte/no-object-in-text-mustaches': string;
'svelte/no-shorthand-style-property-overrides': string;
'svelte/no-unknown-style-directive-property': string;
'svelte/no-unused-svelte-ignore': string;
'svelte/system': string;
'svelte/valid-compile': string;
};
})[];
export default _default;
import type { Linter } from 'eslint';
declare const config: Linter.FlatConfig[];
export default config;

@@ -6,9 +6,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "pnpm run update"
const base_1 = __importDefault(require("./base"));
exports.default = [
const config = [
...base_1.default,
{
name: 'svelte:recommended:rules',
rules: {

@@ -33,1 +31,2 @@ // eslint-plugin-svelte rules

];
exports.default = config;

@@ -1,17 +0,3 @@

declare const _default: {
extends: string[];
rules: {
'svelte/first-attribute-linebreak': string;
'svelte/html-closing-bracket-spacing': string;
'svelte/html-quotes': string;
'svelte/html-self-closing': string;
'svelte/indent': string;
'svelte/max-attributes-per-line': string;
'svelte/mustache-spacing': string;
'svelte/no-spaces-around-equal-signs-in-attribute': string;
'svelte/no-trailing-spaces': string;
'svelte/shorthand-attribute': string;
'svelte/shorthand-directive': string;
};
};
export = _default;
import type { Linter } from 'eslint';
declare const config: Linter.Config;
export = config;

@@ -5,9 +5,6 @@ "use strict";

};
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "pnpm run update"
const path_1 = __importDefault(require("path"));
const node_path_1 = __importDefault(require("node:path"));
const base = require.resolve('./base');
const baseExtend = path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
module.exports = {
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
const config = {
extends: [baseExtend],

@@ -29,1 +26,2 @@ rules: {

};
module.exports = config;

@@ -1,20 +0,3 @@

declare const _default: {
extends: string[];
rules: {
'svelte/comment-directive': string;
'svelte/no-at-debug-tags': string;
'svelte/no-at-html-tags': string;
'svelte/no-dupe-else-if-blocks': string;
'svelte/no-dupe-style-properties': string;
'svelte/no-dynamic-slot-name': string;
'svelte/no-inner-declarations': string;
'svelte/no-not-function-handler': string;
'svelte/no-object-in-text-mustaches': string;
'svelte/no-shorthand-style-property-overrides': string;
'svelte/no-unknown-style-directive-property': string;
'svelte/no-unused-svelte-ignore': string;
'svelte/system': string;
'svelte/valid-compile': string;
};
};
export = _default;
import type { Linter } from 'eslint';
declare const config: Linter.Config;
export = config;

@@ -5,9 +5,6 @@ "use strict";

};
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "pnpm run update"
const path_1 = __importDefault(require("path"));
const node_path_1 = __importDefault(require("node:path"));
const base = require.resolve('./base');
const baseExtend = path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
module.exports = {
const baseExtend = node_path_1.default.extname(`${base}`) === '.ts' ? 'plugin:svelte/base' : base;
const config = {
extends: [baseExtend],

@@ -32,1 +29,2 @@ rules: {

};
module.exports = config;

@@ -7,175 +7,10 @@ import './rule-types';

configs: {
base: {
plugins: string[];
overrides: {
files: string[];
parser: string;
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
}[];
};
recommended: {
extends: string[];
rules: {
'svelte/comment-directive': string;
'svelte/no-at-debug-tags': string;
'svelte/no-at-html-tags': string;
'svelte/no-dupe-else-if-blocks': string;
'svelte/no-dupe-style-properties': string;
'svelte/no-dynamic-slot-name': string;
'svelte/no-inner-declarations': string;
'svelte/no-not-function-handler': string;
'svelte/no-object-in-text-mustaches': string;
'svelte/no-shorthand-style-property-overrides': string;
'svelte/no-unknown-style-directive-property': string;
'svelte/no-unused-svelte-ignore': string;
'svelte/system': string;
'svelte/valid-compile': string;
};
};
prettier: {
extends: string[];
rules: {
'svelte/first-attribute-linebreak': string;
'svelte/html-closing-bracket-spacing': string;
'svelte/html-quotes': string;
'svelte/html-self-closing': string;
'svelte/indent': string;
'svelte/max-attributes-per-line': string;
'svelte/mustache-spacing': string;
'svelte/no-spaces-around-equal-signs-in-attribute': string;
'svelte/no-trailing-spaces': string;
'svelte/shorthand-attribute': string;
'svelte/shorthand-directive': string;
};
};
all: {
extends: string[];
rules: any;
};
'flat/base': ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
})[];
'flat/recommended': ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: {
'svelte/comment-directive': string;
'svelte/no-at-debug-tags': string;
'svelte/no-at-html-tags': string;
'svelte/no-dupe-else-if-blocks': string;
'svelte/no-dupe-style-properties': string;
'svelte/no-dynamic-slot-name': string;
'svelte/no-inner-declarations': string;
'svelte/no-not-function-handler': string;
'svelte/no-object-in-text-mustaches': string;
'svelte/no-shorthand-style-property-overrides': string;
'svelte/no-unknown-style-directive-property': string;
'svelte/no-unused-svelte-ignore': string;
'svelte/system': string;
'svelte/valid-compile': string;
};
})[];
'flat/prettier': ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: {
'svelte/first-attribute-linebreak': string;
'svelte/html-closing-bracket-spacing': string;
'svelte/html-quotes': string;
'svelte/html-self-closing': string;
'svelte/indent': string;
'svelte/max-attributes-per-line': string;
'svelte/mustache-spacing': string;
'svelte/no-spaces-around-equal-signs-in-attribute': string;
'svelte/no-trailing-spaces': string;
'svelte/shorthand-attribute': string;
'svelte/shorthand-directive': string;
};
})[];
'flat/all': ({
plugins: {
readonly svelte: import("eslint").ESLint.Plugin;
};
files?: undefined;
languageOptions?: undefined;
rules?: undefined;
processor?: undefined;
} | {
files: string[];
languageOptions: {
parser: any;
};
rules: {
'no-inner-declarations': string;
'no-self-assign': string;
'svelte/comment-directive': string;
'svelte/system': string;
};
processor: string;
plugins?: undefined;
} | {
rules: any;
})[];
base: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
recommended: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
prettier: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
all: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord, import("eslint").Linter.RulesRecord>;
'flat/base': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
'flat/recommended': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
'flat/prettier': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
'flat/all': import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
};

@@ -182,0 +17,0 @@ rules: {

export declare const name = "eslint-plugin-svelte";
export declare const version = "2.40.0";
export declare const version = "2.41.0";

@@ -8,2 +8,2 @@ "use strict";

exports.name = 'eslint-plugin-svelte';
exports.version = '2.40.0';
exports.version = '2.41.0';

@@ -26,3 +26,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.supportsAutofix = exports.postprocess = exports.preprocess = exports.meta = void 0;
exports.supportsAutofix = exports.meta = void 0;
exports.preprocess = preprocess;
exports.postprocess = postprocess;
const shared_1 = require("../shared");

@@ -37,3 +39,2 @@ exports.meta = __importStar(require("../meta"));

}
exports.preprocess = preprocess;
/** postprocess */

@@ -47,3 +48,2 @@ function postprocess([messages], filename) {

}
exports.postprocess = postprocess;
exports.supportsAutofix = true;

@@ -50,0 +50,0 @@ /** Filter */

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNotWhitespace = exports.isWhitespace = void 0;
exports.isWhitespace = isWhitespace;
exports.isNotWhitespace = isNotWhitespace;
/**

@@ -12,3 +13,2 @@ * Check whether the given token is a whitespace.

}
exports.isWhitespace = isWhitespace;
/**

@@ -22,2 +22,1 @@ * Check whether the given token is a not whitespace.

}
exports.isNotWhitespace = isNotWhitespace;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBeginningOfElement = exports.isBeginningOfLine = exports.getFirstAndLastTokens = void 0;
exports.getFirstAndLastTokens = getFirstAndLastTokens;
exports.isBeginningOfLine = isBeginningOfLine;
exports.isBeginningOfElement = isBeginningOfElement;
const eslint_utils_1 = require("@eslint-community/eslint-utils");

@@ -32,3 +34,2 @@ const ast_1 = require("./ast");

}
exports.getFirstAndLastTokens = getFirstAndLastTokens;
/**

@@ -44,3 +45,2 @@ * Check whether the given node or token is the beginning of a line.

}
exports.isBeginningOfLine = isBeginningOfLine;
/**

@@ -67,3 +67,2 @@ * Check whether the given node is the beginning of element.

}
exports.isBeginningOfElement = isBeginningOfElement;
/**

@@ -70,0 +69,0 @@ * Throws an error when invoked.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineVisitor = void 0;
exports.defineVisitor = defineVisitor;
const commons_1 = require("./commons");

@@ -16,5 +16,5 @@ const eslint_utils_1 = require("@eslint-community/eslint-utils");

/**
* Find the root of left node.
* Find the head of chaining nodes.
*/
function getRootLeft(node) {
function getChainHeadNode(node) {
let target = node;

@@ -28,3 +28,8 @@ let parent = (0, ast_utils_1.getParent)(target);

const prevToken = sourceCode.getTokenBefore(target);
if (prevToken && (0, eslint_utils_1.isOpeningParenToken)(prevToken)) {
const nextToken = sourceCode.getTokenAfter(target);
if (prevToken &&
(0, eslint_utils_1.isOpeningParenToken)(prevToken) &&
nextToken &&
(0, eslint_utils_1.isClosingParenToken)(nextToken)) {
// The chain is broken because it is enclosed in parentheses.
break;

@@ -35,3 +40,3 @@ }

}
return target.left;
return target;
}

@@ -77,3 +82,3 @@ const visitor = {

AssignmentExpression(node) {
const leftNode = getRootLeft(node);
const baseNode = getChainHeadNode(node);
const opToken = sourceCode.getTokenAfter(node.left, {

@@ -83,4 +88,8 @@ filter: eslint_utils_1.isNotClosingParenToken,

});
const baseToken = baseNode.type === 'AssignmentExpression' || baseNode.type === 'AssignmentPattern'
? sourceCode.getFirstToken(baseNode)
: (0, commons_1.getFirstAndLastTokens)(sourceCode, baseNode).firstToken;
const leftToken = (0, commons_1.getFirstAndLastTokens)(sourceCode, node.left).firstToken;
const rightToken = (0, commons_1.getFirstAndLastTokens)(sourceCode, node.right).firstToken;
offsets.setOffsetToken([opToken, rightToken], 1, (0, commons_1.getFirstAndLastTokens)(sourceCode, leftNode).firstToken);
offsets.setOffsetToken([leftToken === baseToken ? null : leftToken, opToken, rightToken], 1, baseToken);
},

@@ -775,3 +784,2 @@ AssignmentPattern(node) {

}
exports.defineVisitor = defineVisitor;
/**

@@ -778,0 +786,0 @@ * Checks whether given text is known button type

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.defineVisitor = void 0;
exports.defineVisitor = defineVisitor;
const SV = __importStar(require("./svelte"));

@@ -266,2 +266,1 @@ const ES = __importStar(require("./es"));

}
exports.defineVisitor = defineVisitor;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineVisitor = void 0;
exports.defineVisitor = defineVisitor;
const ast_1 = require("./ast");

@@ -448,3 +448,2 @@ const commons_1 = require("./commons");

}
exports.defineVisitor = defineVisitor;
/**

@@ -451,0 +450,0 @@ * Check whether the given node is not an empty text node.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineVisitor = void 0;
exports.defineVisitor = defineVisitor;
const eslint_utils_1 = require("@eslint-community/eslint-utils");

@@ -886,2 +886,1 @@ const commons_1 = require("./commons");

}
exports.defineVisitor = defineVisitor;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createStoreChecker = exports.extractStoreReferences = void 0;
exports.extractStoreReferences = extractStoreReferences;
exports.createStoreChecker = createStoreChecker;
const eslint_utils_1 = require("@eslint-community/eslint-utils");

@@ -31,3 +32,2 @@ const ts_utils_1 = require("../../utils/ts-utils");

}
exports.extractStoreReferences = extractStoreReferences;
/**

@@ -43,3 +43,2 @@ * Creates a function that checks whether the given expression node is a store instance or not.

}
exports.createStoreChecker = createStoreChecker;
/**

@@ -46,0 +45,0 @@ * Creates a function that checks whether the given expression node is a store instance or not, for EcmaScript.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getShared = exports.terminateShared = exports.beginShared = exports.Shared = void 0;
exports.Shared = void 0;
exports.beginShared = beginShared;
exports.terminateShared = terminateShared;
exports.getShared = getShared;
const comment_directives_1 = require("./comment-directives");

@@ -21,3 +24,2 @@ class Shared {

}
exports.beginShared = beginShared;
/** Get the shared data and end the sharing. */

@@ -29,3 +31,2 @@ function terminateShared(filename) {

}
exports.terminateShared = terminateShared;
/** If sharing has started, get the shared data. */

@@ -35,2 +36,1 @@ function getShared(filename) {

}
exports.getShared = getShared;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractLeadingComments = void 0;
exports.extractLeadingComments = extractLeadingComments;
const eslint_utils_1 = require("@eslint-community/eslint-utils");

@@ -29,3 +29,2 @@ const compat_1 = require("../../utils/compat");

}
exports.extractLeadingComments = extractLeadingComments;
/** Checks whether given token is comment token */

@@ -32,0 +31,0 @@ function isComment(token) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSvelteIgnoreItems = void 0;
exports.getSvelteIgnoreItems = getSvelteIgnoreItems;
const compat_1 = require("../../utils/compat");

@@ -57,3 +57,2 @@ const SVELTE_IGNORE_PATTERN = /^\s*svelte-ignore/m;

}
exports.getSvelteIgnoreItems = getSvelteIgnoreItems;
/** Extract svelte-ignore rule names */

@@ -60,0 +59,0 @@ function extractSvelteIgnore(text, startIndex, token) {

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getSvelteCompileWarnings = void 0;
exports.getSvelteCompileWarnings = getSvelteCompileWarnings;
const compiler = __importStar(require("svelte/compiler"));

@@ -76,3 +76,2 @@ const sourcemap_codec_1 = require("@jridgewell/sourcemap-codec");

}
exports.getSvelteCompileWarnings = getSvelteCompileWarnings;
/**

@@ -79,0 +78,0 @@ * Get svelte compile warnings

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasBabel = exports.transform = void 0;
exports.transform = transform;
exports.hasBabel = hasBabel;
const load_module_1 = require("../../../utils/load-module");

@@ -44,3 +45,2 @@ const compat_1 = require("../../../utils/compat");

}
exports.transform = transform;
/** Check if project has Babel. */

@@ -50,3 +50,2 @@ function hasBabel(context) {

}
exports.hasBabel = hasBabel;
/**

@@ -53,0 +52,0 @@ * Load babel

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transform = void 0;
exports.transform = transform;
const load_module_1 = require("../../../utils/load-module");

@@ -46,3 +46,2 @@ const compat_1 = require("../../../utils/compat");

}
exports.transform = transform;
/**

@@ -49,0 +48,0 @@ * Load less

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.transform = void 0;
exports.transform = transform;
const postcss_1 = __importDefault(require("postcss"));

@@ -51,2 +51,1 @@ const postcss_load_config_1 = __importDefault(require("postcss-load-config"));

}
exports.transform = transform;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transform = void 0;
exports.transform = transform;
const load_module_1 = require("../../../utils/load-module");

@@ -39,3 +39,2 @@ /**

}
exports.transform = transform;
/**

@@ -42,0 +41,0 @@ * Load sass

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transform = void 0;
exports.transform = transform;
const load_module_1 = require("../../../utils/load-module");

@@ -44,3 +44,2 @@ const compat_1 = require("../../../utils/compat");

}
exports.transform = transform;
/**

@@ -47,0 +46,0 @@ * Load stylus

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasTypeScript = exports.transform = void 0;
exports.transform = transform;
exports.hasTypeScript = hasTypeScript;
const load_module_1 = require("../../../utils/load-module");

@@ -45,3 +46,2 @@ const compat_1 = require("../../../utils/compat");

}
exports.transform = transform;
/** Check if project has TypeScript. */

@@ -51,3 +51,2 @@ function hasTypeScript(context) {

}
exports.hasTypeScript = hasTypeScript;
/**

@@ -54,0 +53,0 @@ * Load typescript

@@ -29,3 +29,22 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isExpressionIdentifier = exports.isVoidHtmlElement = exports.getNodeName = exports.getDirectiveName = exports.getAttributeKeyText = exports.getMustacheTokens = exports.getAttributeValueQuoteAndRange = exports.getParent = exports.getScope = exports.iterateIdentifiers = exports.findVariable = exports.getLangValue = exports.getStaticAttributeValue = exports.findBindDirective = exports.findShorthandAttribute = exports.findAttribute = exports.isHTMLElementLike = exports.needParentheses = exports.getStringIfConstant = exports.equalTokens = void 0;
exports.equalTokens = equalTokens;
exports.getStringIfConstant = getStringIfConstant;
exports.needParentheses = needParentheses;
exports.isHTMLElementLike = isHTMLElementLike;
exports.findAttribute = findAttribute;
exports.findShorthandAttribute = findShorthandAttribute;
exports.findBindDirective = findBindDirective;
exports.getStaticAttributeValue = getStaticAttributeValue;
exports.getLangValue = getLangValue;
exports.findVariable = findVariable;
exports.iterateIdentifiers = iterateIdentifiers;
exports.getScope = getScope;
exports.getParent = getParent;
exports.getAttributeValueQuoteAndRange = getAttributeValueQuoteAndRange;
exports.getMustacheTokens = getMustacheTokens;
exports.getAttributeKeyText = getAttributeKeyText;
exports.getDirectiveName = getDirectiveName;
exports.getNodeName = getNodeName;
exports.isVoidHtmlElement = isVoidHtmlElement;
exports.isExpressionIdentifier = isExpressionIdentifier;
const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));

@@ -54,3 +73,2 @@ const void_elements_1 = __importDefault(require("./void-elements"));

}
exports.equalTokens = equalTokens;
/**

@@ -97,3 +115,2 @@ * Get the value of a given node if it's a literal or a template literal.

}
exports.getStringIfConstant = getStringIfConstant;
/**

@@ -117,3 +134,2 @@ * Check if it need parentheses.

}
exports.needParentheses = needParentheses;
/** Checks whether the given node is the html element node or <svelte:element> node. */

@@ -133,3 +149,2 @@ function isHTMLElementLike(node) {

}
exports.isHTMLElementLike = isHTMLElementLike;
/**

@@ -149,3 +164,2 @@ * Find the attribute from the given element node

}
exports.findAttribute = findAttribute;
/**

@@ -165,3 +179,2 @@ * Find the shorthand attribute from the given element node

}
exports.findShorthandAttribute = findShorthandAttribute;
/**

@@ -181,3 +194,2 @@ * Find the bind directive from the given element node

}
exports.findBindDirective = findBindDirective;
/**

@@ -198,3 +210,2 @@ * Get the static attribute value from given attribute

}
exports.getStaticAttributeValue = getStaticAttributeValue;
/**

@@ -207,3 +218,2 @@ * Get the static attribute value from given attribute

}
exports.getLangValue = getLangValue;
/**

@@ -224,3 +234,2 @@ * Find the variable of a given name.

}
exports.findVariable = findVariable;
/**

@@ -264,3 +273,2 @@ * Iterate the identifiers of a given pattern node.

}
exports.iterateIdentifiers = iterateIdentifiers;
/**

@@ -283,3 +291,2 @@ * Gets the scope for the current node

}
exports.getScope = getScope;
/** Get the parent node from the given node */

@@ -290,3 +297,2 @@ function getParent(node) {

}
exports.getParent = getParent;
/** Get the quote and range from given attribute values */

@@ -331,3 +337,2 @@ function getAttributeValueQuoteAndRange(attr, sourceCode) {

}
exports.getAttributeValueQuoteAndRange = getAttributeValueQuoteAndRange;
/** Get the mustache tokens from given node */

@@ -371,3 +376,2 @@ function getMustacheTokens(node, sourceCode) {

}
exports.getMustacheTokens = getMustacheTokens;
function isWrappedInBraces(node) {

@@ -401,3 +405,2 @@ return (node.type === 'SvelteMustacheTag' ||

}
exports.getAttributeKeyText = getAttributeKeyText;
/** Get directive name */

@@ -426,3 +429,2 @@ function getDirectiveName(node) {

}
exports.getDirectiveName = getDirectiveName;
/** Get the value tokens from given attribute */

@@ -456,3 +458,2 @@ function getAttributeValueRangeTokens(attr, sourceCode) {

}
exports.getNodeName = getNodeName;
/**

@@ -465,3 +466,2 @@ * Returns true if element is known void element

}
exports.isVoidHtmlElement = isVoidHtmlElement;
/** Checks whether the given identifier node is used as an expression. */

@@ -503,3 +503,2 @@ function isExpressionIdentifier(node) {

}
exports.isExpressionIdentifier = isExpressionIdentifier;
/** Get simple name from give node */

@@ -506,0 +505,0 @@ function getSimpleNameFromNode(node, context) {

@@ -8,3 +8,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createCache = void 0;
exports.createCache = createCache;
const SKIP_TIME = 5000;

@@ -54,2 +54,1 @@ /**

}
exports.createCache = createCache;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCwd = exports.getPhysicalFilename = exports.getFilename = exports.getSourceCode = void 0;
exports.getSourceCode = getSourceCode;
exports.getFilename = getFilename;
exports.getPhysicalFilename = getPhysicalFilename;
exports.getCwd = getCwd;
const eslint_compat_utils_1 = require("eslint-compat-utils");

@@ -14,3 +17,2 @@ // export function getSourceCode(context: RuleContext): SourceCode;

}
exports.getSourceCode = getSourceCode;
/**

@@ -22,3 +24,2 @@ * Gets the value of `context.filename`, but for older ESLint it returns the result of `context.getFilename()`.

}
exports.getFilename = getFilename;
/**

@@ -33,3 +34,2 @@ * Gets the value of `context.physicalFilename`,

}
exports.getPhysicalFilename = getPhysicalFilename;
/**

@@ -42,2 +42,1 @@ * Gets the value of `context.cwd`, but for older ESLint it returns the result of `context.getCwd()`.

}
exports.getCwd = getCwd;

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.parseStyleAttributeValue = void 0;
exports.parseStyleAttributeValue = parseStyleAttributeValue;
const template_safe_parser_1 = __importDefault(require("./template-safe-parser"));

@@ -52,3 +52,2 @@ const postcss_1 = require("postcss");

}
exports.parseStyleAttributeValue = parseStyleAttributeValue;
class IgnoreError extends Error {

@@ -55,0 +54,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripVendorPrefix = exports.getVendorPrefix = exports.hasVendorPrefix = void 0;
exports.hasVendorPrefix = hasVendorPrefix;
exports.getVendorPrefix = getVendorPrefix;
exports.stripVendorPrefix = stripVendorPrefix;
/**

@@ -10,3 +12,2 @@ * Checks whether given property name has vender prefix

}
exports.hasVendorPrefix = hasVendorPrefix;
/**

@@ -18,3 +19,2 @@ * Get the vender prefix from given property name

}
exports.getVendorPrefix = getVendorPrefix;
/**

@@ -26,2 +26,1 @@ * Strip the vender prefix

}
exports.stripVendorPrefix = stripVendorPrefix;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCoreRule = exports.buildProxyListener = exports.getProxyNode = exports.defineWrapperListener = void 0;
exports.defineWrapperListener = defineWrapperListener;
exports.getProxyNode = getProxyNode;
exports.buildProxyListener = buildProxyListener;
exports.getCoreRule = getCoreRule;
const eslint_1 = require("eslint");

@@ -13,3 +16,2 @@ /**

}
exports.defineWrapperListener = defineWrapperListener;
/**

@@ -32,3 +34,2 @@ * Get the proxy node

}
exports.getProxyNode = getProxyNode;
/**

@@ -54,3 +55,2 @@ * Build the proxy rule listener

}
exports.buildProxyListener = buildProxyListener;
let ruleMap = null;

@@ -75,2 +75,1 @@ /**

}
exports.getCoreRule = getCoreRule;

@@ -9,3 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getPackageJson = void 0;
exports.getPackageJson = getPackageJson;
const fs_1 = __importDefault(require("fs"));

@@ -76,2 +76,1 @@ const path_1 = __importDefault(require("path"));

}
exports.getPackageJson = getPackageJson;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createRule = void 0;
exports.createRule = createRule;
/**

@@ -23,2 +23,1 @@ * Define the rule.

}
exports.createRule = createRule;

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.loadModulesForBrowser = exports.loadModule = void 0;
exports.loadModule = loadModule;
exports.loadModulesForBrowser = loadModulesForBrowser;
const module_1 = __importDefault(require("module"));

@@ -54,3 +55,2 @@ const path_1 = __importDefault(require("path"));

}
exports.loadModule = loadModule;
/** Load modules for browser */

@@ -62,2 +62,1 @@ async function loadModulesForBrowser() {

}
exports.loadModulesForBrowser = loadModulesForBrowser;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isRegExp = exports.toRegExp = void 0;
exports.toRegExp = toRegExp;
exports.isRegExp = isRegExp;
const RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;

@@ -20,3 +21,2 @@ /**

}
exports.toRegExp = toRegExp;
/**

@@ -30,2 +30,1 @@ * Checks whether given string is regexp string

}
exports.isRegExp = isRegExp;

@@ -9,3 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isKitPageComponent = void 0;
exports.isKitPageComponent = isKitPageComponent;
const fs_1 = __importDefault(require("fs"));

@@ -36,3 +36,2 @@ const path_1 = __importDefault(require("path"));

}
exports.isKitPageComponent = isKitPageComponent;
/**

@@ -39,0 +38,0 @@ * Check givin file is under SvelteKit project.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTypeOfPropertyOfType = exports.getTypeName = exports.getConstrainedTypeAtLocation = exports.getCallSignaturesOfType = exports.isPossiblyFalsyType = exports.isNullType = exports.isVoidType = exports.isUndefinedType = exports.isNeverType = exports.isUnknownType = exports.isAnyType = exports.isTupleType = exports.isTupleObjectType = exports.isReferenceObjectType = exports.isObjectType = exports.isBooleanLiteralType = exports.isNullableType = exports.isNullishType = exports.isFalsyType = exports.isTruthyLiteral = exports.getTypeScript = exports.getTypeScriptTools = void 0;
exports.getTypeScriptTools = getTypeScriptTools;
exports.getTypeScript = getTypeScript;
exports.isTruthyLiteral = isTruthyLiteral;
exports.isFalsyType = isFalsyType;
exports.isNullishType = isNullishType;
exports.isNullableType = isNullableType;
exports.isBooleanLiteralType = isBooleanLiteralType;
exports.isObjectType = isObjectType;
exports.isReferenceObjectType = isReferenceObjectType;
exports.isTupleObjectType = isTupleObjectType;
exports.isTupleType = isTupleType;
exports.isAnyType = isAnyType;
exports.isUnknownType = isUnknownType;
exports.isNeverType = isNeverType;
exports.isUndefinedType = isUndefinedType;
exports.isVoidType = isVoidType;
exports.isNullType = isNullType;
exports.isPossiblyFalsyType = isPossiblyFalsyType;
exports.getCallSignaturesOfType = getCallSignaturesOfType;
exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation;
exports.getTypeName = getTypeName;
exports.getTypeOfPropertyOfType = getTypeOfPropertyOfType;
const load_module_1 = require("../load-module");

@@ -34,3 +55,2 @@ const compat_1 = require("../compat");

}
exports.getTypeScriptTools = getTypeScriptTools;
let cacheTypeScript = null;

@@ -57,3 +77,2 @@ /**

}
exports.getTypeScript = getTypeScript;
/**

@@ -70,3 +89,2 @@ * Check whether the given type is a truthy literal type or not.

}
exports.isTruthyLiteral = isTruthyLiteral;
/**

@@ -88,3 +106,2 @@ * Check whether the given type is a falsy type or not.

}
exports.isFalsyType = isFalsyType;
/**

@@ -99,3 +116,2 @@ * Check whether the given type is a nullish type or not.

}
exports.isNullishType = isNullishType;
/**

@@ -110,3 +126,2 @@ * Checks whether the given type is nullable or not.

}
exports.isNullableType = isNullableType;
/**

@@ -118,3 +133,2 @@ * Check whether the given type is a boolean literal type or not.

}
exports.isBooleanLiteralType = isBooleanLiteralType;
/**

@@ -126,3 +140,2 @@ * Check whether the given type is an object type or not.

}
exports.isObjectType = isObjectType;
/**

@@ -134,3 +147,2 @@ * Check whether the given type is a reference type or not.

}
exports.isReferenceObjectType = isReferenceObjectType;
/**

@@ -142,3 +154,2 @@ * Check whether the given type is a tuple type or not.

}
exports.isTupleObjectType = isTupleObjectType;
/**

@@ -152,3 +163,2 @@ * Check whether the given type is a tuple type or not.

}
exports.isTupleType = isTupleType;
/**

@@ -160,3 +170,2 @@ * Check whether the given type is an any type or not.

}
exports.isAnyType = isAnyType;
/**

@@ -168,3 +177,2 @@ * Check whether the given type is an unknown type or not.

}
exports.isUnknownType = isUnknownType;
/**

@@ -176,3 +184,2 @@ * Check whether the given type is a never type or not.

}
exports.isNeverType = isNeverType;
/**

@@ -184,3 +191,2 @@ * Check whether the given type is an undefined type or not.

}
exports.isUndefinedType = isUndefinedType;
/**

@@ -192,3 +198,2 @@ * Check whether the given type is a void type or not.

}
exports.isVoidType = isVoidType;
/**

@@ -200,3 +205,2 @@ * Check whether the given type is a null type or not.

}
exports.isNullType = isNullType;
/**

@@ -211,3 +215,2 @@ * Check whether the given type is a possibly falsy type or not.

}
exports.isPossiblyFalsyType = isPossiblyFalsyType;
/**

@@ -239,3 +242,2 @@ * Get the call signatures from the given type.

}
exports.getCallSignaturesOfType = getCallSignaturesOfType;
/**

@@ -252,3 +254,2 @@ * Resolves the given node's type. Will resolve to the type's generic constraint, if it has one.

}
exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation;
/**

@@ -300,3 +301,2 @@ * Get the type name of a given type.

}
exports.getTypeName = getTypeName;
/**

@@ -309,2 +309,1 @@ * Return the type of the given property in the given type, or undefined if no such property exists

}
exports.getTypeOfPropertyOfType = getTypeOfPropertyOfType;
{
"name": "eslint-plugin-svelte",
"version": "2.40.0",
"version": "2.41.0",
"description": "ESLint plugin for Svelte using AST",

@@ -63,3 +63,3 @@ "repository": "git+https://github.com/sveltejs/eslint-plugin-svelte.git",

"esutils": "^2.0.3",
"known-css-properties": "^0.32.0",
"known-css-properties": "^0.34.0",
"postcss": "^8.4.38",

@@ -70,3 +70,3 @@ "postcss-load-config": "^3.1.4",

"semver": "^7.6.2",
"svelte-eslint-parser": "^0.39.1"
"svelte-eslint-parser": "^0.39.2"
},

@@ -73,0 +73,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc