lint-suite 2.0.0 → 2.0.1
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 +1 -1
- package/eslint.cjs +5 -5
- package/eslint.cjs.map +2 -2
- package/eslint.js +5 -5
- package/eslint.js.map +2 -2
- package/package.json +1 -1
package/eslint.js
CHANGED
|
@@ -6937,13 +6937,13 @@ import { ESLintUtils as ESLintUtils19, TSESTree as TSESTree31 } from "@typescrip
|
|
|
6937
6937
|
// packages/lint-suite/src/lib/rules/type-placement/common/type-placement.const.ts
|
|
6938
6938
|
var DEFAULT_INTERNAL_PATTERNS = [];
|
|
6939
6939
|
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"
|
|
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 or *.schema.ts files or a common barrel"
|
|
6941
6941
|
};
|
|
6942
6942
|
var messages19 = {
|
|
6943
6943
|
typeOutsideTypeFile: "Exported type '{{ name }}' belongs in a common/*.type.ts or test/common/*.type.ts file, not here.",
|
|
6944
6944
|
valueInTypeFile: "A *.type.ts file may only export type aliases and interfaces.",
|
|
6945
6945
|
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."
|
|
6946
|
+
typeImportNotFromTypeFile: "Type-only import from '{{ source }}' must come from a *.type.ts or *.schema.ts file, or a common barrel."
|
|
6947
6947
|
};
|
|
6948
6948
|
var stringItems2 = { type: "string" };
|
|
6949
6949
|
var internalPatternsSchema = {
|
|
@@ -6974,10 +6974,10 @@ var defaultOptions10 = [
|
|
|
6974
6974
|
var TYPE_FILE_SUFFIX = ".type.ts";
|
|
6975
6975
|
var CONST_FILE_SUFFIX = ".const.ts";
|
|
6976
6976
|
var COMMON_SEGMENT = "/common/";
|
|
6977
|
-
var EXEMPT_FILE = /\.(spec|stub|d)\.ts$/;
|
|
6977
|
+
var EXEMPT_FILE = /\.(spec|stub|schema|d)\.ts$/;
|
|
6978
6978
|
var STATE_TYPE_FILE = /(^|[./])state\.type\.ts$/;
|
|
6979
6979
|
var FIXTURES_SEGMENT2 = "/fixtures/";
|
|
6980
|
-
var
|
|
6980
|
+
var TYPE_SOURCE_SEGMENT = /\.(type|schema)(\.ts)?$/;
|
|
6981
6981
|
var COMMON_BARREL = /(^|\/)common(\/index(\.ts)?)?$/;
|
|
6982
6982
|
var createRule19 = ESLintUtils19.RuleCreator(
|
|
6983
6983
|
() => "https://github.com/F0rty-Tw0/lint-suite#type-placement"
|
|
@@ -6996,7 +6996,7 @@ var lastSegment = (source) => {
|
|
|
6996
6996
|
var isTypeOnlySource = (source) => {
|
|
6997
6997
|
const isCommonBarrel = COMMON_BARREL.test(source);
|
|
6998
6998
|
if (isCommonBarrel) return true;
|
|
6999
|
-
return
|
|
6999
|
+
return TYPE_SOURCE_SEGMENT.test(lastSegment(source));
|
|
7000
7000
|
};
|
|
7001
7001
|
var isInternalSource = (source, patterns) => {
|
|
7002
7002
|
const isRelative = source.startsWith(".");
|