@maprox/lint-config 1.8.1 → 1.9.0
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/package.json +1 -1
- package/src/eslint/portable.js +16 -1
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ Vue stays on the ESLint `./vue` preset for now.
|
|
|
118
118
|
|
|
119
119
|
## What is included
|
|
120
120
|
|
|
121
|
-
- **Base / portable:** `@stylistic` (including single quotes via `@stylistic/quotes`), import order (`import-x` + `import-newlines`), TS strictness, type-aware rules for `*.ts`, relative-import ban, `@typescript-eslint/no-shadow` (core `no-shadow` off), `curly` / `no-console`, complexity metrics (`complexity` ≤10, `max-params` ≤4, `max-depth` ≤3, `max-lines-per-function` ≤40, `max-statements` ≤20), etc. Enums are PascalCase with `UPPER_CASE` members. Boolean variables and parameters are PascalCase with a prefix of `is`, `should`, `has`, `can`, `did`, or `will` (`isReady`, `hasError`). Needs a usable `tsconfig.json` (`project: true`).
|
|
121
|
+
- **Base / portable:** `@stylistic` (including single quotes via `@stylistic/quotes`), import order (`import-x` + `import-newlines`), `import/consistent-type-specifier-style` (`prefer-top-level` on `*.ts` / `*.tsx` / `*.mts` / `*.cts` / `*.vue`, syntactic and separate from the type-aware override, so `import type` stays separate from value imports), TS strictness, type-aware rules for `*.ts`, relative-import ban, `@typescript-eslint/no-shadow` (core `no-shadow` off), `curly` / `no-console`, `eqeqeq` (`['error', 'always']` — `===` / `!==` only, including comparisons with `null`; `null: 'ignore'` is not set), complexity metrics (`complexity` ≤10, `max-params` ≤4, `max-depth` ≤3, `max-lines-per-function` ≤40, `max-statements` ≤20), etc. Enums are PascalCase with `UPPER_CASE` members. Boolean variables and parameters are PascalCase with a prefix of `is`, `should`, `has`, `can`, `did`, or `will` (`isReady`, `hasError`). For an object that is either present or missing (`object | undefined`) and has no meaningful falsy values (`0`, `''`, `false`), prefer a truthy check (`if (scope)`) over comparing with `null` or `undefined`. Needs a usable `tsconfig.json` (`project: true`).
|
|
122
122
|
- **Vue:** `createConfigForNuxt` + portable layer + Vue SFC-only rules; type-aware rules also cover `.vue` `<script>` (`extraFileExtensions`).
|
|
123
123
|
- **Astro / Node:** extend base with their parsers/globals.
|
|
124
124
|
- **Tailwind (opt-in `./tailwind`):** `eslint-plugin-tailwindcss@4` `classnames-order` + required `cssConfigPath`.
|
package/package.json
CHANGED
package/src/eslint/portable.js
CHANGED
|
@@ -99,7 +99,14 @@ export const portableOverrides = [
|
|
|
99
99
|
},
|
|
100
100
|
],
|
|
101
101
|
'@stylistic/quote-props': ['error', 'as-needed'],
|
|
102
|
-
'@stylistic/quotes': [
|
|
102
|
+
'@stylistic/quotes': [
|
|
103
|
+
'error',
|
|
104
|
+
'single',
|
|
105
|
+
{
|
|
106
|
+
avoidEscape: true,
|
|
107
|
+
allowTemplateLiterals: 'always',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
103
110
|
'import/order': [
|
|
104
111
|
'error',
|
|
105
112
|
{
|
|
@@ -133,6 +140,7 @@ export const portableOverrides = [
|
|
|
133
140
|
],
|
|
134
141
|
'switch-colon-spacing': ['error', { after: true, before: false }],
|
|
135
142
|
curly: 'error',
|
|
143
|
+
eqeqeq: ['error', 'always'],
|
|
136
144
|
},
|
|
137
145
|
},
|
|
138
146
|
{
|
|
@@ -144,6 +152,13 @@ export const portableOverrides = [
|
|
|
144
152
|
},
|
|
145
153
|
rules: typeAwareTsRules,
|
|
146
154
|
},
|
|
155
|
+
// Syntactic: no project:true. *.vue is listed here so vue.js can keep spreading typeAwareTsRules.
|
|
156
|
+
{
|
|
157
|
+
files: ['**/*.{ts,tsx,mts,cts,vue}'],
|
|
158
|
+
rules: {
|
|
159
|
+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
147
162
|
noRelativeImports({
|
|
148
163
|
message:
|
|
149
164
|
'Relative imports are forbidden. Use path aliases (~, ~~, #domain, #application, #infra, #mocks, #app, #components).',
|