@maprox/lint-config 1.8.2 → 1.10.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 +9 -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` and no semicolons via `@stylistic/semi` `['error', 'never']`), 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
|
@@ -107,6 +107,7 @@ export const portableOverrides = [
|
|
|
107
107
|
allowTemplateLiterals: 'always',
|
|
108
108
|
},
|
|
109
109
|
],
|
|
110
|
+
'@stylistic/semi': ['error', 'never'],
|
|
110
111
|
'import/order': [
|
|
111
112
|
'error',
|
|
112
113
|
{
|
|
@@ -140,6 +141,7 @@ export const portableOverrides = [
|
|
|
140
141
|
],
|
|
141
142
|
'switch-colon-spacing': ['error', { after: true, before: false }],
|
|
142
143
|
curly: 'error',
|
|
144
|
+
eqeqeq: ['error', 'always'],
|
|
143
145
|
},
|
|
144
146
|
},
|
|
145
147
|
{
|
|
@@ -151,6 +153,13 @@ export const portableOverrides = [
|
|
|
151
153
|
},
|
|
152
154
|
rules: typeAwareTsRules,
|
|
153
155
|
},
|
|
156
|
+
// Syntactic: no project:true. *.vue is listed here so vue.js can keep spreading typeAwareTsRules.
|
|
157
|
+
{
|
|
158
|
+
files: ['**/*.{ts,tsx,mts,cts,vue}'],
|
|
159
|
+
rules: {
|
|
160
|
+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
161
|
+
},
|
|
162
|
+
},
|
|
154
163
|
noRelativeImports({
|
|
155
164
|
message:
|
|
156
165
|
'Relative imports are forbidden. Use path aliases (~, ~~, #domain, #application, #infra, #mocks, #app, #components).',
|