@dezkareid/eslint-plugin-web
v1.1.2
Published
Custom ESLint plugin with shared configurations and rules for web projects in the `dezkareid` monorepo.
Maintainers
Readme
@dezkareid/eslint-plugin-web
Custom ESLint plugin with shared configurations and rules for web projects in the dezkareid monorepo.
Installation
pnpm add -D @dezkareid/eslint-plugin-webUsage
Each config is available as a named entrypoint. Import only the config(s) you need — this way you only need to install the peer dependencies relevant to your project.
// eslint.config.mjs
import tsBase from '@dezkareid/eslint-config-ts-base';
import reactConfig from '@dezkareid/eslint-plugin-web/react';
export default [
...tsBase,
...reactConfig,
];Configs
typescript
Entrypoint: @dezkareid/eslint-plugin-web/typescript
Extends @dezkareid/eslint-config-ts-base. Applies TypeScript-aware linting rules using typescript-eslint.
Peer dependencies: none beyond eslint.
import typescriptConfig from '@dezkareid/eslint-plugin-web/typescript';
export default [
...typescriptConfig,
];react
Entrypoint: @dezkareid/eslint-plugin-web/react
Linting for React projects. Includes:
@eslint-react/eslint-pluginrecommended ruleseslint-plugin-unicornrecommended rules- Override to allow
Ref/refabbreviations (conflicts with@eslint-react/naming-convention/ref-name)
Required peer:
pnpm add -D @eslint-react/eslint-pluginimport reactConfig from '@dezkareid/eslint-plugin-web/react';
export default [
...reactConfig,
];next
Entrypoint: @dezkareid/eslint-plugin-web/next
Linting for Next.js projects. Extends react and includes:
@next/eslint-plugin-nextrecommended andcore-web-vitalsrules- Override for
unicorn/prefer-string-raw: disabled formiddleware.tsandproxy.ts(common Next.js middleware filenames)
Required peer:
pnpm add -D @next/eslint-plugin-next @eslint-react/eslint-pluginimport nextConfig from '@dezkareid/eslint-plugin-web/next';
export default [
...nextConfig,
];astro
Entrypoint: @dezkareid/eslint-plugin-web/astro
Linting for Astro projects. Includes:
eslint-plugin-astrorecommended ruleseslint-plugin-unicornrecommended rules- Overrides for Astro filename conventions (PascalCase and kebab-case)
- Suppresses
@typescript-eslint/no-unused-varsforProperties(implicit viaAstro.props)
Required peer:
pnpm add -D eslint-plugin-astroimport astroConfig from '@dezkareid/eslint-plugin-web/astro';
export default [
...astroConfig,
];css
Entrypoint: @dezkareid/eslint-plugin-web/css
Linting for CSS files using @eslint/css. Targets **/*.css files.
Peer dependencies: none beyond eslint (@eslint/css is bundled).
| Rule | Severity | Description |
|------|----------|-------------|
| css/no-duplicate-imports | error | Disallows duplicate @import statements |
| css/no-empty-blocks | error | Disallows empty rule blocks |
| css/no-invalid-at-rules | error | Disallows unknown at-rules |
| css/no-invalid-properties | error | Disallows invalid CSS property/value pairs |
| css/use-baseline | warn | Warns when using CSS features not yet widely available across browsers |
import cssConfig from '@dezkareid/eslint-plugin-web/css';
export default [
...cssConfig,
];Rules
The plugin also exposes custom rules. To use them, import the full plugin:
web/no-jquery
Disallows importing jquery. Reports an error on any import from 'jquery'.
import web from '@dezkareid/eslint-plugin-web';
export default [
{
plugins: { web },
rules: {
'web/no-jquery': 'error',
},
},
];web/no-allowed-packages
Disallows importing from a configurable list of forbidden packages.
Options: array of package name strings to forbid.
import web from '@dezkareid/eslint-plugin-web';
export default [
{
plugins: { web },
rules: {
'web/no-allowed-packages': ['error', 'lodash', 'moment'],
},
},
];Requirements
- Node >= 22
- ESLint
>=9.39.2(peer dependency)
