@maprox/lint-config 1.8.2 → 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 +8 -0
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
|
@@ -140,6 +140,7 @@ export const portableOverrides = [
|
|
|
140
140
|
],
|
|
141
141
|
'switch-colon-spacing': ['error', { after: true, before: false }],
|
|
142
142
|
curly: 'error',
|
|
143
|
+
eqeqeq: ['error', 'always'],
|
|
143
144
|
},
|
|
144
145
|
},
|
|
145
146
|
{
|
|
@@ -151,6 +152,13 @@ export const portableOverrides = [
|
|
|
151
152
|
},
|
|
152
153
|
rules: typeAwareTsRules,
|
|
153
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
|
+
},
|
|
154
162
|
noRelativeImports({
|
|
155
163
|
message:
|
|
156
164
|
'Relative imports are forbidden. Use path aliases (~, ~~, #domain, #application, #infra, #mocks, #app, #components).',
|