@th1o/frontend-lint 0.0.1 → 0.0.3

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/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PACKAGE_NAMESPACE } from "./namespace-nrXFf9VY.mjs";
1
+ import { n as PACKAGE_NAMESPACE } from "./namespace-Dr1zqW02.mjs";
2
2
  import process from "node:process";
3
3
  import fs from "node:fs/promises";
4
4
  import fs$1 from "node:fs";
@@ -10,7 +10,7 @@ import parse from "parse-gitignore";
10
10
  import { execSync } from "node:child_process";
11
11
 
12
12
  //#region package.json
13
- var version = "0.0.1";
13
+ var version = "0.0.3";
14
14
 
15
15
  //#endregion
16
16
  //#region src/cli/constants.ts
package/dist/index.d.mts CHANGED
@@ -4,6 +4,7 @@ import { StylisticCustomizeOptions } from "@stylistic/eslint-plugin";
4
4
  import { ParserOptions } from "@typescript-eslint/parser";
5
5
  import { FlatGitignoreOptions } from "eslint-config-flat-gitignore";
6
6
  import { Options } from "eslint-processor-vue-blocks";
7
+ import { Config } from "stylelint";
7
8
 
8
9
  //#region src/typegen.d.ts
9
10
  interface RuleOptions {
@@ -19453,6 +19454,7 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
19453
19454
  ignores?: string[] | ((originals: string[]) => string[]);
19454
19455
  /**
19455
19456
  * Disable some opinionated rules to Anthony's preference.
19457
+ * 不需要设置个人风格化,团队通过的标准直接写在默认中
19456
19458
  *
19457
19459
  * Including:
19458
19460
  * - `antfu/top-level-function`
@@ -19838,6 +19840,9 @@ declare const GLOB_TESTS: string[];
19838
19840
  declare const GLOB_ALL_SRC: string[];
19839
19841
  declare const GLOB_EXCLUDE: string[];
19840
19842
  //#endregion
19843
+ //#region src/stylelint.d.ts
19844
+ declare function createStylelintConfig(overrides?: Config['rules']): Config;
19845
+ //#endregion
19841
19846
  //#region src/utils.d.ts
19842
19847
  declare const parserPlain: {
19843
19848
  meta: {
@@ -19911,4 +19916,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
19911
19916
  declare function isInEditorEnv(): boolean;
19912
19917
  declare function isInGitHooksOrLintStaged(): boolean;
19913
19918
  //#endregion
19914
- export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, createESLintConfig, createESLintConfig as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
19919
+ export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, astro, combine, command, comments, createESLintConfig, createESLintConfig as default, createStylelintConfig, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PACKAGE_NAMESPACE, t as LINT_NAMESPACE } from "./namespace-nrXFf9VY.mjs";
1
+ import { n as PACKAGE_NAMESPACE, t as LINT_NAMESPACE } from "./namespace-Dr1zqW02.mjs";
2
2
  import { FlatConfigComposer } from "eslint-flat-config-utils";
3
3
  import process from "node:process";
4
4
  import fs from "node:fs/promises";
@@ -397,10 +397,7 @@ async function stylistic(options = {}) {
397
397
  [`${LINT_NAMESPACE}/consistent-chaining`]: "error",
398
398
  [`${LINT_NAMESPACE}/top-level-function`]: "error",
399
399
  "curly": ["error", "all"],
400
- "style/array-bracket-newline": ["error", {
401
- minItems: 3,
402
- multiline: true
403
- }],
400
+ "style/array-bracket-newline": ["error", { multiline: true }],
404
401
  "style/brace-style": ["error", "1tbs"],
405
402
  "style/comma-dangle": ["error", {
406
403
  arrays: "always-multiline",
@@ -418,14 +415,8 @@ async function stylistic(options = {}) {
418
415
  }],
419
416
  "style/linebreak-style": ["error", "unix"],
420
417
  "style/object-curly-newline": ["error", {
421
- ObjectExpression: {
422
- minProperties: 3,
423
- multiline: true
424
- },
425
- ObjectPattern: {
426
- minProperties: 3,
427
- multiline: true
428
- }
418
+ consistent: true,
419
+ multiline: true
429
420
  }],
430
421
  "style/object-curly-spacing": ["error", "always"],
431
422
  "style/space-before-function-paren": ["error", {
@@ -2093,7 +2084,7 @@ async function typescript(options = {}) {
2093
2084
  }] : [],
2094
2085
  ...erasableOnly ? [{
2095
2086
  name: `${LINT_NAMESPACE}/typescript/erasable-syntax-only`,
2096
- plugins: { "erasable-syntax-only": await interopDefault(import("./lib-CJY3aRgd.mjs")) },
2087
+ plugins: { "erasable-syntax-only": await interopDefault(import("./lib-DteMLVEl.mjs")) },
2097
2088
  rules: {
2098
2089
  "erasable-syntax-only/enums": "error",
2099
2090
  "erasable-syntax-only/import-aliases": "error",
@@ -2300,6 +2291,7 @@ async function vue(options = {}) {
2300
2291
  "vue/no-setup-props-reactivity-loss": "off",
2301
2292
  "vue/no-sparse-arrays": "error",
2302
2293
  "vue/no-unused-refs": "error",
2294
+ "vue/no-unused-vars": "off",
2303
2295
  "vue/no-useless-v-bind": "error",
2304
2296
  "vue/no-v-html": "off",
2305
2297
  "vue/object-shorthand": [
@@ -2352,7 +2344,10 @@ async function vue(options = {}) {
2352
2344
  after: true,
2353
2345
  before: true
2354
2346
  }],
2355
- "vue/object-curly-newline": "off",
2347
+ "vue/object-curly-newline": ["error", {
2348
+ consistent: true,
2349
+ multiline: true
2350
+ }],
2356
2351
  "vue/object-curly-spacing": ["error", "always"],
2357
2352
  "vue/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
2358
2353
  "vue/operator-linebreak": ["error", "before"],
@@ -2662,9 +2657,28 @@ const CONFIG_PRESET_FULL_OFF = {
2662
2657
  yaml: false
2663
2658
  };
2664
2659
 
2660
+ //#endregion
2661
+ //#region src/stylelint.ts
2662
+ function createStylelintConfig(overrides) {
2663
+ return {
2664
+ extends: [
2665
+ "stylelint-config-standard",
2666
+ "stylelint-config-recess-order",
2667
+ "stylelint-config-recommended-vue"
2668
+ ],
2669
+ rules: {
2670
+ "declaration-no-important": true,
2671
+ "function-url-quotes": "never",
2672
+ "import-notation": "string",
2673
+ "selector-max-id": [0, { ignoreContextFunctionalPseudoClasses: [":not", "/^:(h|H)as$/"] }],
2674
+ ...overrides
2675
+ }
2676
+ };
2677
+ }
2678
+
2665
2679
  //#endregion
2666
2680
  //#region src/index.ts
2667
2681
  var src_default = createESLintConfig;
2668
2682
 
2669
2683
  //#endregion
2670
- export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, createESLintConfig, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
2684
+ export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, StylisticConfigDefaults, astro, combine, command, comments, createESLintConfig, createStylelintConfig, src_default as default, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
@@ -0,0 +1,6 @@
1
+ //#region src/namespace.ts
2
+ const LINT_NAMESPACE = "ynzh";
3
+ const PACKAGE_NAMESPACE = "@th1o/frontend-lint";
4
+
5
+ //#endregion
6
+ export { PACKAGE_NAMESPACE as n, LINT_NAMESPACE as t };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@th1o/frontend-lint",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "description": "ESLint config",
6
6
  "author": "张天昊 <theozhang.tech@outlook.com>",
7
7
  "keywords": [
@@ -10,7 +10,6 @@
10
10
  "exports": {
11
11
  ".": "./dist/index.mjs",
12
12
  "./cli": "./dist/cli.mjs",
13
- "./stylelint": "./dist/stylelint.mjs",
14
13
  "./package.json": "./package.json"
15
14
  },
16
15
  "main": "./dist/index.mjs",
@@ -126,9 +125,11 @@
126
125
  "jsonc-eslint-parser": "^2.4.2",
127
126
  "local-pkg": "^1.1.2",
128
127
  "parse-gitignore": "^2.0.0",
128
+ "postcss-html": "^1.5.0",
129
129
  "stylelint-config-recess-order": "^7.6.0",
130
130
  "stylelint-config-recommended-vue": "^1.6.1",
131
131
  "stylelint-config-standard": "^40.0.0",
132
+ "stylelint-order": "^7.0.0",
132
133
  "toml-eslint-parser": "^1.0.3",
133
134
  "vue-eslint-parser": "^10.2.0",
134
135
  "yaml-eslint-parser": "^2.0.0"
@@ -173,7 +174,7 @@
173
174
  "typescript": "^5.9.3",
174
175
  "vitest": "^4.0.18",
175
176
  "vue": "^3.5.27",
176
- "frontend-lint": "npm:@th1o/frontend-lint@0.0.1"
177
+ "@th1o/frontend-lint": "0.0.3"
177
178
  },
178
179
  "resolutions": {
179
180
  "@eslint-community/eslint-utils": "catalog:peer",
@@ -203,6 +204,7 @@
203
204
  "release": "bumpp",
204
205
  "test": "vitest",
205
206
  "typecheck": "tsc --noEmit",
206
- "up": "taze --interactive"
207
+ "up": "taze --interactive",
208
+ "publish:npm": "pnpm publish --access public --registry https://registry.npmjs.org/"
207
209
  }
208
210
  }
@@ -1,6 +0,0 @@
1
- //#region src/namespace.ts
2
- const LINT_NAMESPACE = "ynzh";
3
- const PACKAGE_NAMESPACE = "frontend-lint";
4
-
5
- //#endregion
6
- export { PACKAGE_NAMESPACE as n, LINT_NAMESPACE as t };
@@ -1,6 +0,0 @@
1
- import { Config } from "stylelint";
2
-
3
- //#region src/stylelint.d.ts
4
- declare function createStylelintConfig(): Config;
5
- //#endregion
6
- export { createStylelintConfig };
@@ -1,18 +0,0 @@
1
- //#region src/stylelint.ts
2
- function createStylelintConfig() {
3
- return {
4
- extends: [
5
- "stylelint-config-standard",
6
- "stylelint-config-recess-order",
7
- "stylelint-config-recommended-vue"
8
- ],
9
- rules: {
10
- "declaration-no-important": true,
11
- "function-url-quotes": "never",
12
- "selector-max-id": [0, { ignoreContextFunctionalPseudoClasses: [":not", "/^:(h|H)as$/"] }]
13
- }
14
- };
15
- }
16
-
17
- //#endregion
18
- export { createStylelintConfig };
File without changes