lint-suite 2.0.0 → 2.0.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/README.md +10 -4
- package/eslint.cjs +22 -9
- package/eslint.cjs.map +2 -2
- package/eslint.js +22 -9
- package/eslint.js.map +2 -2
- package/lib/rules/no-unused-classes/no-unused-classes.d.ts.map +1 -1
- package/lib/rules/no-unused-classes/template/template-usage.d.ts.map +1 -1
- package/lib/rules/utils/template-classes.util.d.ts +2 -0
- package/lib/rules/utils/template-classes.util.d.ts.map +1 -1
- package/lib/typescript-safety.d.ts.map +1 -1
- package/package.json +1 -1
- package/stylelint.cjs +31 -10
- package/stylelint.cjs.map +3 -3
- package/stylelint.js +31 -10
- package/stylelint.js.map +3 -3
package/eslint.js
CHANGED
|
@@ -668,7 +668,12 @@ var classExpressionLiterals = (source) => {
|
|
|
668
668
|
};
|
|
669
669
|
|
|
670
670
|
// packages/lint-suite/src/lib/rules/utils/template-classes.util.ts
|
|
671
|
-
var
|
|
671
|
+
var CLASS_ATTRIBUTES = [
|
|
672
|
+
"class",
|
|
673
|
+
"routerLinkActive",
|
|
674
|
+
"animate.enter",
|
|
675
|
+
"animate.leave"
|
|
676
|
+
];
|
|
672
677
|
var CLASS_BINDING_PREFIX = "class.";
|
|
673
678
|
var TOKEN = /\S+/gu;
|
|
674
679
|
var expressionSource = (value) => {
|
|
@@ -697,11 +702,11 @@ var boundClassName = (input) => {
|
|
|
697
702
|
return input.name;
|
|
698
703
|
};
|
|
699
704
|
var isClassExpression = (input) => {
|
|
700
|
-
const isClassName = input.name
|
|
705
|
+
const isClassName = CLASS_ATTRIBUTES.includes(input.name);
|
|
701
706
|
if (!isClassName) return false;
|
|
702
707
|
const { details } = input.keySpan;
|
|
703
708
|
if (details === null) return true;
|
|
704
|
-
return details ===
|
|
709
|
+
return details === input.name;
|
|
705
710
|
};
|
|
706
711
|
var expressionClasses = (input) => {
|
|
707
712
|
const source = expressionSource(input.value);
|
|
@@ -726,7 +731,7 @@ var inputClasses = (input) => {
|
|
|
726
731
|
var templateClasses = (node) => {
|
|
727
732
|
const classes = [];
|
|
728
733
|
for (const attribute of node.attributes) {
|
|
729
|
-
const isClassName = attribute.name
|
|
734
|
+
const isClassName = CLASS_ATTRIBUTES.includes(attribute.name);
|
|
730
735
|
if (isClassName) {
|
|
731
736
|
const found = staticClasses(attribute);
|
|
732
737
|
classes.push(...found);
|
|
@@ -6937,13 +6942,13 @@ import { ESLintUtils as ESLintUtils19, TSESTree as TSESTree31 } from "@typescrip
|
|
|
6937
6942
|
// packages/lint-suite/src/lib/rules/type-placement/common/type-placement.const.ts
|
|
6938
6943
|
var DEFAULT_INTERNAL_PATTERNS = [];
|
|
6939
6944
|
var docs19 = {
|
|
6940
|
-
description: "Require types to live in common/*.type.ts files, *.const.ts files to export only consts, and type-only imports to come from *.type.ts files or a common barrel"
|
|
6945
|
+
description: "Require types to live in common/*.type.ts files, *.const.ts files to export only consts, and type-only imports to come from *.type.ts or *.schema.ts files or a common barrel"
|
|
6941
6946
|
};
|
|
6942
6947
|
var messages19 = {
|
|
6943
6948
|
typeOutsideTypeFile: "Exported type '{{ name }}' belongs in a common/*.type.ts or test/common/*.type.ts file, not here.",
|
|
6944
6949
|
valueInTypeFile: "A *.type.ts file may only export type aliases and interfaces.",
|
|
6945
6950
|
nonConstInConstFile: "A *.const.ts file may only export const variable declarations.",
|
|
6946
|
-
typeImportNotFromTypeFile: "Type-only import from '{{ source }}' must come from a *.type.ts file or a common barrel."
|
|
6951
|
+
typeImportNotFromTypeFile: "Type-only import from '{{ source }}' must come from a *.type.ts or *.schema.ts file, or a common barrel."
|
|
6947
6952
|
};
|
|
6948
6953
|
var stringItems2 = { type: "string" };
|
|
6949
6954
|
var internalPatternsSchema = {
|
|
@@ -6974,10 +6979,10 @@ var defaultOptions10 = [
|
|
|
6974
6979
|
var TYPE_FILE_SUFFIX = ".type.ts";
|
|
6975
6980
|
var CONST_FILE_SUFFIX = ".const.ts";
|
|
6976
6981
|
var COMMON_SEGMENT = "/common/";
|
|
6977
|
-
var EXEMPT_FILE = /\.(spec|stub|d)\.ts$/;
|
|
6982
|
+
var EXEMPT_FILE = /\.(spec|stub|schema|d)\.ts$/;
|
|
6978
6983
|
var STATE_TYPE_FILE = /(^|[./])state\.type\.ts$/;
|
|
6979
6984
|
var FIXTURES_SEGMENT2 = "/fixtures/";
|
|
6980
|
-
var
|
|
6985
|
+
var TYPE_SOURCE_SEGMENT = /\.(type|schema)(\.ts)?$/;
|
|
6981
6986
|
var COMMON_BARREL = /(^|\/)common(\/index(\.ts)?)?$/;
|
|
6982
6987
|
var createRule19 = ESLintUtils19.RuleCreator(
|
|
6983
6988
|
() => "https://github.com/F0rty-Tw0/lint-suite#type-placement"
|
|
@@ -6996,7 +7001,7 @@ var lastSegment = (source) => {
|
|
|
6996
7001
|
var isTypeOnlySource = (source) => {
|
|
6997
7002
|
const isCommonBarrel = COMMON_BARREL.test(source);
|
|
6998
7003
|
if (isCommonBarrel) return true;
|
|
6999
|
-
return
|
|
7004
|
+
return TYPE_SOURCE_SEGMENT.test(lastSegment(source));
|
|
7000
7005
|
};
|
|
7001
7006
|
var isInternalSource = (source, patterns) => {
|
|
7002
7007
|
const isRelative = source.startsWith(".");
|
|
@@ -7418,6 +7423,14 @@ var typescriptSafety = defineConfig18([
|
|
|
7418
7423
|
// Class actions carry their payload as constructor parameter properties.
|
|
7419
7424
|
"@typescript-eslint/parameter-properties": "off"
|
|
7420
7425
|
}
|
|
7426
|
+
},
|
|
7427
|
+
{
|
|
7428
|
+
files: ["**/*.stub.ts"],
|
|
7429
|
+
rules: {
|
|
7430
|
+
// local/test-file-shape requires STUB: Type; a literal stub would trip
|
|
7431
|
+
// no-inferrable-types.
|
|
7432
|
+
"@typescript-eslint/no-inferrable-types": "off"
|
|
7433
|
+
}
|
|
7421
7434
|
}
|
|
7422
7435
|
]);
|
|
7423
7436
|
|