@kirill.konshin/lint 0.4.1 → 0.4.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kirill.konshin/lint",
3
3
  "description": "ESLint + Prettier + lint-staged config and AI agent rules/skills for monorepos",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "type": "module",
6
6
  "skipGenerate": true,
7
7
  "bin": {
package/rules/mui.md CHANGED
@@ -5,8 +5,16 @@ paths:
5
5
  - '**/*.tsx'
6
6
  ---
7
7
 
8
- - To use MUI default classes always use following notation because it's the only one that works with minification:
9
- - Import: `import Input, { inputClasses } from '@mui/material/Input';`
8
+ - Full adherence to MUI best practices, which preserve semantics and accessibility
9
+ - If contradicts or not sure, as user what to do
10
+ - No negative margins hacks or similar
11
+ - Use bare minimum of JSX to code needed behavior
12
+ - Good example: `Toolbar → ButtonGroup → anchored Menu`
13
+ - Always import components or icons this way: `import { Paper, Button } from '@mui/material';` and `import { Xxx } from '@mui/icons-material';`
14
+ - See barrel handling section
15
+ - Exception: if developing a library use direct imports with minimal bundle footprint (libraries may not be used with barrel handling)
16
+ - To use MUI default classes always use stable minifiable class names:
17
+ - Import: `import { inputClasses } from '@mui/material';` or `import { inputClasses } from '@mui/material/Input';` (see rule about imports)
10
18
  - Usage: `<Box sx={{ [``& .${inputClasses.root}``]: { /* styles */ } }}><Input /></Box>`
11
19
 
12
20
  # Admin Pages & Login
package/rules/nextjs.md CHANGED
@@ -11,10 +11,14 @@ _EVERY_ Next.js page, layout, route handler or component must adhere to policy u
11
11
  - Never use Pages Router
12
12
  - Always use App Router
13
13
  - Use `iron-session` for authentication via `@kirill.konshin/auth`, see auth.md
14
- - Server-only modules (auth/session, DB access, anything touching secrets) MUST start with `import 'server-only'` (the npm package, add as dependency) — ENFORCED BY AGENT: no ESLint rule checks this, add it when creating such modules and flag it when reviewing
14
+ - Server-only modules (auth/session, DB access, anything touching secrets, `'use server'` actions files) MUST start with `import 'server-only'` (the npm package, add as dependency) — ENFORCED BY AGENT: no ESLint rule checks this, add it when creating such modules and flag it when reviewing
15
15
  - `package.json` MUST ALWAYS have version of Next.js, NEVER `*`, otherwise Vercel will fall into legacy mode instead of serverless
16
16
  - ALWAYS create `next.config.ts` with `defineNextConfig` from `@kirill.konshin/next/config` (the `/config` subpath, NEVER the barrel — Next transpiles `next.config.ts` to CJS and `require`s it outside any bundler): sets `cacheComponents`, `typedRoutes`, `experimental.typedEnv`, `reactStrictMode: false` and an exhaustive `experimental.optimizePackageImports` (`@mui/*`, `@toolpad/core`, `@fortawesome/*`, `@gravity-ui/*`, `lodash`, `@heroui/react`, `react-bootstrap`, `@kirill.konshin/icons` — extra entries are ignored, missing ones cost dev startup and bundle size, see mui.md)
17
17
  - Use `@kirill.konshin/icons` for FontAwesome / Gravity UI icons — the barrel is safe with `optimizePackageImports` (`defineNextConfig` sets it)
18
+ - Do not make dummy pages that only import components, pages can be client, and should have most logic baked in, including one-off components (not exported)
19
+ - Reusable components should be in `src/components`
20
+ - As exception, separate component files are allowed to be in `src/app` next to relevant pages if one-off component is large so page itself becomes bloated, but `src/components` should not be polluted with one-offs, ask user if not sure
21
+ - Example: `actions.ts` for `'use server'` actions while page is `'use client'`
18
22
 
19
23
  # Admin Pages & Login
20
24