πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
DemoInstallSign in
Socket

eslint-plugin-readable-tailwind

Package Overview
Dependencies
Maintainers
0
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-readable-tailwind - npm Package Compare versions

Comparing version

to
2.0.0

lib/cjs/tailwind/async/class-variant.async.d.ts

9

lib/cjs/configs/config.d.ts

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

import { tailwindMultiline } from "../rules/tailwind-multiline.js";
import { tailwindNoDuplicateClasses } from "../rules/tailwind-no-duplicate-classes.js";
import { tailwindNoUnnecessaryWhitespace } from "../rules/tailwind-no-unnecessary-whitespace.js";
import { tailwindSortClasses } from "../rules/tailwind-sort-classes.js";
export declare const config: {

@@ -15,5 +19,8 @@ configs: {

rules: {
[x: string]: import("eslint").Rule.RuleModule;
[tailwindMultiline.name]: import("eslint").Rule.RuleModule;
[tailwindNoDuplicateClasses.name]: import("eslint").Rule.RuleModule;
[tailwindNoUnnecessaryWhitespace.name]: import("eslint").Rule.RuleModule;
[tailwindSortClasses.name]: import("eslint").Rule.RuleModule;
};
};
//# sourceMappingURL=config.d.ts.map

2

lib/cjs/parsers/html.d.ts

@@ -5,5 +5,5 @@ import type { AttributeNode, TagNode } from "es-html-parser";

import type { Attributes } from "../types/rule.js";
export declare function getLiteralsByHTMLAttributes(ctx: Rule.RuleContext, attribute: AttributeNode, attributes: Attributes): Literal[];
export declare function getLiteralsByHTMLAttribute(ctx: Rule.RuleContext, attribute: AttributeNode, attributes: Attributes): Literal[];
export declare function getAttributesByHTMLTag(ctx: Rule.RuleContext, node: TagNode): AttributeNode[];
export declare function getLiteralsByHTMLAttributeNode(ctx: Rule.RuleContext, attribute: AttributeNode): Literal[];
//# sourceMappingURL=html.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLiteralsByHTMLAttributes = getLiteralsByHTMLAttributes;
exports.getLiteralsByHTMLAttribute = getLiteralsByHTMLAttribute;
exports.getAttributesByHTMLTag = getAttributesByHTMLTag;

@@ -8,6 +8,6 @@ exports.getLiteralsByHTMLAttributeNode = getLiteralsByHTMLAttributeNode;

const readable_tailwind_utils_utils_js_1 = require("../utils/utils.js");
function getLiteralsByHTMLAttributes(ctx, attribute, attributes) {
function getLiteralsByHTMLAttribute(ctx, attribute, attributes) {
const literals = attributes.reduce((literals, attributes) => {
if ((0, readable_tailwind_utils_matchers_js_1.isAttributesName)(attributes)) {
if (attributes.toLowerCase() !== attribute.key.value.toLowerCase()) {
if (!(0, readable_tailwind_utils_utils_js_1.matchesName)(attributes.toLowerCase(), attribute.key.value.toLowerCase())) {
return literals;

@@ -14,0 +14,0 @@ }

@@ -5,4 +5,4 @@ import type { Rule } from "eslint";

import type { Attributes } from "../types/rule.js";
export declare function getLiteralsByJSXAttributes(ctx: Rule.RuleContext, attribute: JSXAttribute, attributes: Attributes): Literal[];
export declare function getLiteralsByJSXAttribute(ctx: Rule.RuleContext, attribute: JSXAttribute, attributes: Attributes): Literal[];
export declare function getAttributesByJSXElement(ctx: Rule.RuleContext, node: JSXOpeningElement): JSXAttribute[];
//# sourceMappingURL=jsx.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLiteralsByJSXAttributes = getLiteralsByJSXAttributes;
exports.getLiteralsByJSXAttribute = getLiteralsByJSXAttribute;
exports.getAttributesByJSXElement = getAttributesByJSXElement;

@@ -9,3 +9,3 @@ const readable_tailwind_parsers_es_js_1 = require("./es.js");

const readable_tailwind_utils_utils_js_1 = require("../utils/utils.js");
function getLiteralsByJSXAttributes(ctx, attribute, attributes) {
function getLiteralsByJSXAttribute(ctx, attribute, attributes) {
const value = attribute.value;

@@ -12,0 +12,0 @@ const literals = attributes.reduce((literals, attributes) => {

@@ -6,3 +6,3 @@ import type { Rule } from "eslint";

export declare function getAttributesBySvelteTag(ctx: Rule.RuleContext, node: SvelteStartTag): SvelteAttribute[];
export declare function getLiteralsBySvelteAttributes(ctx: Rule.RuleContext, attribute: SvelteAttribute, attributes: Attributes): Literal[];
export declare function getLiteralsBySvelteAttribute(ctx: Rule.RuleContext, attribute: SvelteAttribute, attributes: Attributes): Literal[];
//# sourceMappingURL=svelte.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttributesBySvelteTag = getAttributesBySvelteTag;
exports.getLiteralsBySvelteAttributes = getLiteralsBySvelteAttributes;
exports.getLiteralsBySvelteAttribute = getLiteralsBySvelteAttribute;
const readable_tailwind_parsers_es_js_1 = require("./es.js");

@@ -18,3 +18,3 @@ const readable_tailwind_types_rule_js_1 = require("../types/rule.js");

}
function getLiteralsBySvelteAttributes(ctx, attribute, attributes) {
function getLiteralsBySvelteAttribute(ctx, attribute, attributes) {
// skip shorthand attributes #42

@@ -21,0 +21,0 @@ if (!Array.isArray(attribute.value)) {

@@ -6,3 +6,3 @@ import type { Rule } from "eslint";

export declare function getAttributesByVueStartTag(ctx: Rule.RuleContext, node: AST.VStartTag): (AST.VAttribute | AST.VDirective)[];
export declare function getLiteralsByVueAttributes(ctx: Rule.RuleContext, attribute: AST.VAttribute | AST.VDirective, attributes: Attributes): Literal[];
export declare function getLiteralsByVueAttribute(ctx: Rule.RuleContext, attribute: AST.VAttribute | AST.VDirective, attributes: Attributes): Literal[];
//# sourceMappingURL=vue.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAttributesByVueStartTag = getAttributesByVueStartTag;
exports.getLiteralsByVueAttributes = getLiteralsByVueAttributes;
exports.getLiteralsByVueAttribute = getLiteralsByVueAttribute;
const readable_tailwind_parsers_es_js_1 = require("./es.js");

@@ -13,3 +13,3 @@ const readable_tailwind_types_rule_js_1 = require("../types/rule.js");

}
function getLiteralsByVueAttributes(ctx, attribute, attributes) {
function getLiteralsByVueAttribute(ctx, attribute, attributes) {
if (attribute.value === null) {

@@ -16,0 +16,0 @@ return [];

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

}
const literals = (0, readable_tailwind_parsers_jsx_js_1.getLiteralsByJSXAttributes)(ctx, jsxAttribute, attributes);
const literals = (0, readable_tailwind_parsers_jsx_js_1.getLiteralsByJSXAttribute)(ctx, jsxAttribute, attributes);
lintLiterals(ctx, literals);

@@ -60,3 +60,3 @@ }

}
const literals = (0, readable_tailwind_parsers_svelte_js_1.getLiteralsBySvelteAttributes)(ctx, svelteAttribute, attributes);
const literals = (0, readable_tailwind_parsers_svelte_js_1.getLiteralsBySvelteAttribute)(ctx, svelteAttribute, attributes);
lintLiterals(ctx, literals);

@@ -71,3 +71,3 @@ }

for (const attribute of vueAttributes) {
const literals = (0, readable_tailwind_parsers_vue_js_1.getLiteralsByVueAttributes)(ctx, attribute, attributes);
const literals = (0, readable_tailwind_parsers_vue_js_1.getLiteralsByVueAttribute)(ctx, attribute, attributes);
lintLiterals(ctx, literals);

@@ -82,3 +82,3 @@ }

for (const htmlAttribute of htmlAttributes) {
const literals = (0, readable_tailwind_parsers_html_js_1.getLiteralsByHTMLAttributes)(ctx, htmlAttribute, attributes);
const literals = (0, readable_tailwind_parsers_html_js_1.getLiteralsByHTMLAttribute)(ctx, htmlAttribute, attributes);
lintLiterals(ctx, literals);

@@ -85,0 +85,0 @@ }

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

import { tailwindMultiline } from "../rules/tailwind-multiline.js";
import { tailwindNoDuplicateClasses } from "../rules/tailwind-no-duplicate-classes.js";
import { tailwindNoUnnecessaryWhitespace } from "../rules/tailwind-no-unnecessary-whitespace.js";
import { tailwindSortClasses } from "../rules/tailwind-sort-classes.js";
export declare const config: {

@@ -15,5 +19,8 @@ configs: {

rules: {
[x: string]: import("eslint").Rule.RuleModule;
[tailwindMultiline.name]: import("eslint").Rule.RuleModule;
[tailwindNoDuplicateClasses.name]: import("eslint").Rule.RuleModule;
[tailwindNoUnnecessaryWhitespace.name]: import("eslint").Rule.RuleModule;
[tailwindSortClasses.name]: import("eslint").Rule.RuleModule;
};
};
//# sourceMappingURL=config.d.ts.map

@@ -5,5 +5,5 @@ import type { AttributeNode, TagNode } from "es-html-parser";

import type { Attributes } from "../types/rule.js";
export declare function getLiteralsByHTMLAttributes(ctx: Rule.RuleContext, attribute: AttributeNode, attributes: Attributes): Literal[];
export declare function getLiteralsByHTMLAttribute(ctx: Rule.RuleContext, attribute: AttributeNode, attributes: Attributes): Literal[];
export declare function getAttributesByHTMLTag(ctx: Rule.RuleContext, node: TagNode): AttributeNode[];
export declare function getLiteralsByHTMLAttributeNode(ctx: Rule.RuleContext, attribute: AttributeNode): Literal[];
//# sourceMappingURL=html.d.ts.map
import { isAttributesMatchers, isAttributesName, isAttributesRegex } from "../utils/matchers.js";
import { deduplicateLiterals } from "../utils/utils.js";
export function getLiteralsByHTMLAttributes(ctx, attribute, attributes) {
import { deduplicateLiterals, matchesName } from "../utils/utils.js";
export function getLiteralsByHTMLAttribute(ctx, attribute, attributes) {
const literals = attributes.reduce((literals, attributes) => {
if (isAttributesName(attributes)) {
if (attributes.toLowerCase() !== attribute.key.value.toLowerCase()) {
if (!matchesName(attributes.toLowerCase(), attribute.key.value.toLowerCase())) {
return literals;

@@ -8,0 +8,0 @@ }

@@ -5,4 +5,4 @@ import type { Rule } from "eslint";

import type { Attributes } from "../types/rule.js";
export declare function getLiteralsByJSXAttributes(ctx: Rule.RuleContext, attribute: JSXAttribute, attributes: Attributes): Literal[];
export declare function getLiteralsByJSXAttribute(ctx: Rule.RuleContext, attribute: JSXAttribute, attributes: Attributes): Literal[];
export declare function getAttributesByJSXElement(ctx: Rule.RuleContext, node: JSXOpeningElement): JSXAttribute[];
//# sourceMappingURL=jsx.d.ts.map

@@ -5,3 +5,3 @@ import { getLiteralsByESMatchers, getLiteralsByESTemplateLiteral, getStringLiteralByESStringLiteral, isESNode, isESSimpleStringLiteral, isESTemplateLiteral } from "./es.js";

import { deduplicateLiterals, matchesName } from "../utils/utils.js";
export function getLiteralsByJSXAttributes(ctx, attribute, attributes) {
export function getLiteralsByJSXAttribute(ctx, attribute, attributes) {
const value = attribute.value;

@@ -8,0 +8,0 @@ const literals = attributes.reduce((literals, attributes) => {

@@ -6,3 +6,3 @@ import type { Rule } from "eslint";

export declare function getAttributesBySvelteTag(ctx: Rule.RuleContext, node: SvelteStartTag): SvelteAttribute[];
export declare function getLiteralsBySvelteAttributes(ctx: Rule.RuleContext, attribute: SvelteAttribute, attributes: Attributes): Literal[];
export declare function getLiteralsBySvelteAttribute(ctx: Rule.RuleContext, attribute: SvelteAttribute, attributes: Attributes): Literal[];
//# sourceMappingURL=svelte.d.ts.map

@@ -14,3 +14,3 @@ import { getLiteralsByESLiteralNode, hasESNodeParentExtension, isESObjectKey, isESStringLike, isInsideObjectValue } from "./es.js";

}
export function getLiteralsBySvelteAttributes(ctx, attribute, attributes) {
export function getLiteralsBySvelteAttribute(ctx, attribute, attributes) {
// skip shorthand attributes #42

@@ -17,0 +17,0 @@ if (!Array.isArray(attribute.value)) {

@@ -6,3 +6,3 @@ import type { Rule } from "eslint";

export declare function getAttributesByVueStartTag(ctx: Rule.RuleContext, node: AST.VStartTag): (AST.VAttribute | AST.VDirective)[];
export declare function getLiteralsByVueAttributes(ctx: Rule.RuleContext, attribute: AST.VAttribute | AST.VDirective, attributes: Attributes): Literal[];
export declare function getLiteralsByVueAttribute(ctx: Rule.RuleContext, attribute: AST.VAttribute | AST.VDirective, attributes: Attributes): Literal[];
//# sourceMappingURL=vue.d.ts.map

@@ -9,3 +9,3 @@ import { getLiteralsByESLiteralNode, hasESNodeParentExtension, isESObjectKey, isESStringLike, isInsideObjectValue } from "./es.js";

}
export function getLiteralsByVueAttributes(ctx, attribute, attributes) {
export function getLiteralsByVueAttribute(ctx, attribute, attributes) {
if (attribute.value === null) {

@@ -12,0 +12,0 @@ return [];

import { getLiteralsByESCallExpression, getLiteralsByESVariableDeclarator, getLiteralsByTaggedTemplateExpression } from "../parsers/es.js";
import { getAttributesByHTMLTag, getLiteralsByHTMLAttributes } from "../parsers/html.js";
import { getAttributesByJSXElement, getLiteralsByJSXAttributes } from "../parsers/jsx.js";
import { getAttributesBySvelteTag, getLiteralsBySvelteAttributes } from "../parsers/svelte.js";
import { getAttributesByVueStartTag, getLiteralsByVueAttributes } from "../parsers/vue.js";
import { getAttributesByHTMLTag, getLiteralsByHTMLAttribute } from "../parsers/html.js";
import { getAttributesByJSXElement, getLiteralsByJSXAttribute } from "../parsers/jsx.js";
import { getAttributesBySvelteTag, getLiteralsBySvelteAttribute } from "../parsers/svelte.js";
import { getAttributesByVueStartTag, getLiteralsByVueAttribute } from "../parsers/vue.js";
export function createRuleListener(ctx, options, lintLiterals) {

@@ -42,3 +42,3 @@ const { attributes, callees, tags, variables } = options;

}
const literals = getLiteralsByJSXAttributes(ctx, jsxAttribute, attributes);
const literals = getLiteralsByJSXAttribute(ctx, jsxAttribute, attributes);
lintLiterals(ctx, literals);

@@ -57,3 +57,3 @@ }

}
const literals = getLiteralsBySvelteAttributes(ctx, svelteAttribute, attributes);
const literals = getLiteralsBySvelteAttribute(ctx, svelteAttribute, attributes);
lintLiterals(ctx, literals);

@@ -68,3 +68,3 @@ }

for (const attribute of vueAttributes) {
const literals = getLiteralsByVueAttributes(ctx, attribute, attributes);
const literals = getLiteralsByVueAttribute(ctx, attribute, attributes);
lintLiterals(ctx, literals);

@@ -79,3 +79,3 @@ }

for (const htmlAttribute of htmlAttributes) {
const literals = getLiteralsByHTMLAttributes(ctx, htmlAttribute, attributes);
const literals = getLiteralsByHTMLAttribute(ctx, htmlAttribute, attributes);
lintLiterals(ctx, literals);

@@ -82,0 +82,0 @@ }

{
"version": "2.0.0-beta.4",
"version": "2.0.0",
"type": "module",

@@ -48,5 +48,5 @@ "name": "eslint-plugin-readable-tailwind",

"prebuild": "npm run typecheck && npm run lint && npm run spellcheck",
"prerelease:alpha": "npm run test && npm run build",
"prerelease:beta": "npm run test && npm run build",
"prerelease:latest": "npm run test && npm run build",
"prerelease:alpha": "npm run test -- --run && npm run build",
"prerelease:beta": "npm run test -- --run && npm run build",
"prerelease:latest": "npm run test -- --run && npm run build",
"pretest:v3": "npm run install:v3",

@@ -62,6 +62,7 @@ "pretest:v4": "npm run install:v4",

"spellcheck:ci": "npm run spellcheck -- --no-progress",
"test": "npm run test:v3 -- --run && npm run test:v4 -- --run",
"test": "vitest -c ./vite.config.ts --exclude tests/e2e",
"test:all": "npm run test:v3 && npm run test:v4",
"test:e2e": "vitest -c ./vite.config.ts tests/e2e --run",
"test:v3": "vitest -c ./vite.config.ts --exclude tests/e2e",
"test:v4": "vitest -c ./vite.config.ts --exclude tests/e2e",
"test:v3": "npm run test -- --run",
"test:v4": "npm run test -- --run",
"typecheck": "tsc --noEmit"

@@ -86,15 +87,12 @@ },

},
"overrides": {
"vite": "^5.0.0"
},
"devDependencies": {
"@html-eslint/parser": "^0.35.0",
"@schoero/configs": "^1.2.10",
"@html-eslint/parser": "^0.35.2",
"@schoero/configs": "^1.2.11",
"@types/estree-jsx": "^1.0.5",
"@types/node": "^22.13.5",
"@typescript-eslint/parser": "^8.25.0",
"changelogen": "^0.6.0",
"@types/node": "^22.13.10",
"@typescript-eslint/parser": "^8.26.0",
"changelogen": "^0.6.1",
"cspell": "^8.17.5",
"es-html-parser": "^0.1.0",
"eslint": "^9.21.0",
"es-html-parser": "^0.1.1",
"eslint": "^9.22.0",
"eslint-plugin-eslint-plugin": "^6.4.0",

@@ -106,5 +104,5 @@ "eslint-plugin-readable-tailwind": "file:./",

"proper-tags": "^2.0.2",
"svelte": "^5.20.5",
"svelte-eslint-parser": "^1.0.0",
"tailwindcss": "^4.0.9",
"svelte": "^5.22.6",
"svelte-eslint-parser": "^1.0.1",
"tailwindcss": "^4.0.12",
"tailwindcss3": "npm:tailwindcss@^3.0.0",

@@ -115,6 +113,6 @@ "tailwindcss4": "npm:tailwindcss@^4.0.0",

"tsx": "^4.19.3",
"typescript": "^5.7.3",
"vite-node": "^3.0.7",
"vitest": "^3.0.7",
"vue-eslint-parser": "^9.4.3"
"typescript": "^5.8.2",
"vite-node": "^3.0.8",
"vitest": "^3.0.8",
"vue-eslint-parser": "^10.1.1"
},

@@ -151,4 +149,4 @@ "keywords": [

"volta": {
"node": "22.13.1"
"node": "22.14.0"
}
}

@@ -68,12 +68,2 @@ <div align="center">

> [!NOTE]
> Support for tailwindcss v4 is currently in beta.
>
> If you are on tailwindcss v4, install the beta version of this plugin: `npm i -D eslint-plugin-readable-tailwind@beta`.
> Please report any feedback or issues you encounter with the beta version in the [discussions](https://github.com/schoero/eslint-plugin-readable-tailwind/discussions/71).
> Additional breaking changes are documented in the [CHANGELOG on the v2 branch](https://github.com/schoero/eslint-plugin-readable-tailwind/blob/v2/CHANGELOG.md).
<br/>
<br/>
<div align="center">

@@ -80,0 +70,0 @@ <img alt="eslint-plugin-readable-tailwind example" width="640px" src="./assets/eslint-plugin-readable-tailwind-demo.webp">

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet