{"_id":"@dmzj/eslint-config","_rev":"2-5d3b604350a365efe65a47e9bc2e8dd4","name":"@dmzj/eslint-config","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@dmzj/eslint-config","type":"module","version":"0.0.0","packageManager":"pnpm@8.6.0","description":"[![NPM version](https://img.shields.io/npm/v/@dmzj/eslint-config?color=a1b858&label=)](https://www.npmjs.com/package/@dmzj/eslint-config)","author":{"name":"DogMan Zhan","email":"zqj1130123899@gmail.com"},"license":"MIT","funding":"https://github.com/sponsors/dmZhan","homepage":"https://github.com/dmZhan/eslint-config#readme","repository":{"type":"git","url":"git+https://github.com/dmZhan/eslint-config.git"},"bugs":{"url":"https://github.com/dmZhan/eslint-config/issues"},"keywords":[],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.cjs","import":"./dist/index.mjs"}},"main":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","typesVersions":{"*":{"*":["./dist/*","./dist/index.d.ts"]}},"scripts":{"build":"unbuild","dev":"unbuild --stub","lint":"eslint .","release":"bumpp && npm publish","start":"esno src/index.ts","test":"vitest","typecheck":"tsc --noEmit"},"devDependencies":{"@antfu/eslint-config":"^0.39.4","@antfu/ni":"^0.21.3","@antfu/utils":"^0.7.4","@types/node":"^18.16.16","bumpp":"^9.1.0","eslint":"^8.41.0","esno":"^0.16.3","lint-staged":"^13.2.2","pnpm":"^8.6.0","rimraf":"^5.0.1","simple-git-hooks":"^2.8.1","typescript":"^5.0.4","unbuild":"^1.2.1","vite":"^4.3.9","vitest":"^0.31.3"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"},"_id":"@dmzj/eslint-config@0.0.0","_nodeVersion":"20.9.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-tb+QUczFcS/1D9cEFD4IcrT1juhyb2T5aFput1FX82pmNxtTQmBtBOID6kbF7wrx/j/oqRI/XOOJ/JKnwLXDjw==","shasum":"b0830c6516bc936507667d6d35aa99bac6f8f1de","tarball":"https://registry.npmjs.org/@dmzj/eslint-config/-/eslint-config-0.0.0.tgz","fileCount":6,"unpackedSize":3240,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLP2D1eNiF7h2hHWhsBkqwDat7rSjyS1O7a2+jm2v03AiB5IjRR2bsqfSJwVHSCek9LWkesc6s5E0mANd8vSX2YPw=="}]},"_npmUser":{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"},"directories":{},"maintainers":[{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config_0.0.0_1698807962416_0.9851983421134458"},"_hasShrinkwrap":false},"0.0.1":{"name":"@dmzj/eslint-config","type":"module","version":"0.0.1","description":"Dmzj's ESLint config.","author":{"name":"dmZhan","email":"zqj1130123899@gmail.com"},"license":"MIT","homepage":"https://github.com/dmZhan/eslint-config","keywords":["eslint-config","antfu"],"exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"main":"./dist/index.js","types":"./dist/index.d.ts","peerDependencies":{"@eslint-react/eslint-plugin":"^1.5.8","@unocss/eslint-plugin":">=0.50.0","astro-eslint-parser":"^0.16.3","eslint":">=8.40.0","eslint-plugin-astro":"^0.31.4","eslint-plugin-format":">=0.1.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.4","eslint-plugin-solid":"^0.13.2","eslint-plugin-svelte":">=2.35.1","prettier-plugin-astro":"^0.13.0","prettier-plugin-slidev":"^1.0.5","svelte-eslint-parser":"^0.33.1"},"peerDependenciesMeta":{"@eslint-react/eslint-plugin":{"optional":true},"@unocss/eslint-plugin":{"optional":true},"astro-eslint-parser":{"optional":true},"eslint-plugin-astro":{"optional":true},"eslint-plugin-format":{"optional":true},"eslint-plugin-react-hooks":{"optional":true},"eslint-plugin-react-refresh":{"optional":true},"eslint-plugin-solid":{"optional":true},"eslint-plugin-svelte":{"optional":true},"prettier-plugin-astro":{"optional":true},"prettier-plugin-slidev":{"optional":true},"svelte-eslint-parser":{"optional":true}},"dependencies":{"@antfu/eslint-config":"^2.16.1","lint-staged":"^15.2.2","simple-git-hooks":"^2.11.1"},"devDependencies":{"bumpp":"^9.4.1","bundle-require":"^4.1.0","eslint-flat-config-utils":"^0.2.4","eslint-flat-config-viewer":"^0.1.20","tsup":"^8.0.2","typescript":"^5.4.5"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --clean --dts","stub":"tsup src/index.ts --format esm","dev":"tsup src/index.ts --format esm,cjs --watch & eslint-flat-config-viewer","lint":"pnpm run stub && eslint .","release":"bumpp && pnpm publish","test":"vitest","typecheck":"tsc --noEmit"},"gitHead":"9600617c52d0d2e48493424c529ac6c945d2775b","_id":"@dmzj/eslint-config@0.0.1","_integrity":"sha512-xBxW9xiUF1AWaJr/Ahs3ce1fl9dluNZucUGaCmzsVp/77AF+Gb6pI3uegmeQ+p//lD9FA9R8eRHog4VAmyxjRA==","_resolved":"/private/var/folders/6d/04ffb0qn4nq0q2cv44h437xh0000gn/T/def49e1d617ff755a91de94e44118aae/dmzj-eslint-config-0.0.1.tgz","_from":"file:dmzj-eslint-config-0.0.1.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-xBxW9xiUF1AWaJr/Ahs3ce1fl9dluNZucUGaCmzsVp/77AF+Gb6pI3uegmeQ+p//lD9FA9R8eRHog4VAmyxjRA==","shasum":"dab107b371b69c724ff19e640aa1cd62d64bb3ab","tarball":"https://registry.npmjs.org/@dmzj/eslint-config/-/eslint-config-0.0.1.tgz","fileCount":7,"unpackedSize":12238,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqU2MFJSSAdIr3DIJUUIWHL0Qaqd/FTUY/VrXtzl+ZjgIgKyKMZWqKqMAeRheaL3Ohzs6INxrXEZ+b+uH17ygjHF0="}]},"_npmUser":{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"},"directories":{},"maintainers":[{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config_0.0.1_1714903612499_0.06100263285129093"},"_hasShrinkwrap":false},"0.0.2":{"name":"@dmzj/eslint-config","type":"module","version":"0.0.2","description":"Dmzj's ESLint config.","author":{"name":"dmZhan","email":"zqj1130123899@gmail.com"},"license":"MIT","homepage":"https://github.com/dmZhan/eslint-config","keywords":["eslint-config","antfu"],"exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"}},"main":"./dist/index.js","types":"./dist/index.d.ts","peerDependencies":{"@eslint-react/eslint-plugin":"^1.5.8","@unocss/eslint-plugin":">=0.50.0","astro-eslint-parser":"^0.16.3","eslint":">=8.40.0","eslint-plugin-astro":"^0.31.4","eslint-plugin-format":">=0.1.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.4","eslint-plugin-solid":"^0.13.2","eslint-plugin-svelte":">=2.35.1","prettier-plugin-astro":"^0.13.0","prettier-plugin-slidev":"^1.0.5","svelte-eslint-parser":"^0.33.1"},"peerDependenciesMeta":{"@eslint-react/eslint-plugin":{"optional":true},"@unocss/eslint-plugin":{"optional":true},"astro-eslint-parser":{"optional":true},"eslint-plugin-astro":{"optional":true},"eslint-plugin-format":{"optional":true},"eslint-plugin-react-hooks":{"optional":true},"eslint-plugin-react-refresh":{"optional":true},"eslint-plugin-solid":{"optional":true},"eslint-plugin-svelte":{"optional":true},"prettier-plugin-astro":{"optional":true},"prettier-plugin-slidev":{"optional":true},"svelte-eslint-parser":{"optional":true}},"dependencies":{"@antfu/eslint-config":"^2.16.1","lint-staged":"^15.2.2","simple-git-hooks":"^2.11.1"},"devDependencies":{"bumpp":"^9.4.1","bundle-require":"^4.1.0","eslint-flat-config-utils":"^0.2.4","eslint-flat-config-viewer":"^0.1.20","tsup":"^8.0.2","typescript":"^5.4.5"},"simple-git-hooks":{"pre-commit":"pnpm lint-staged"},"lint-staged":{"*":"eslint --fix"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --clean --dts","stub":"tsup src/index.ts --format esm","dev":"tsup src/index.ts --format esm,cjs --watch & eslint-flat-config-viewer","lint":"pnpm run stub && eslint .","release":"bumpp && pnpm publish","test":"vitest","typecheck":"tsc --noEmit"},"gitHead":"9600617c52d0d2e48493424c529ac6c945d2775b","_id":"@dmzj/eslint-config@0.0.2","_integrity":"sha512-fX/zWOflPwIa0p9MI5CwrhZflbmFI4OlWYek2gyEaIX0wjAq3O4R1Laok/dx+Ud1thJ7y1MDxf5t66p2OsAi4A==","_resolved":"/private/var/folders/6d/04ffb0qn4nq0q2cv44h437xh0000gn/T/84aa6b3fe80880eca43e503020a02a0b/dmzj-eslint-config-0.0.2.tgz","_from":"file:dmzj-eslint-config-0.0.2.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-fX/zWOflPwIa0p9MI5CwrhZflbmFI4OlWYek2gyEaIX0wjAq3O4R1Laok/dx+Ud1thJ7y1MDxf5t66p2OsAi4A==","shasum":"0907f95c130cfe1cef1a6ad917fdddf66ddc5ca1","tarball":"https://registry.npmjs.org/@dmzj/eslint-config/-/eslint-config-0.0.2.tgz","fileCount":7,"unpackedSize":12244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2E0IxB8b+4kQ4ZVfjedPyZnlHhM/VjgTJzrDk9Jd9JwIhAM4JH6YEWopFl6sARRsCLQWzWVFyeZ3jsBFcPSOPHR+X"}]},"_npmUser":{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"},"directories":{},"maintainers":[{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-config_0.0.2_1714904139969_0.6093335367285635"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-01T03:06:02.203Z","0.0.0":"2023-11-01T03:06:02.691Z","modified":"2024-05-05T10:15:40.357Z","0.0.1":"2024-05-05T10:06:52.659Z","0.0.2":"2024-05-05T10:15:40.173Z"},"maintainers":[{"name":"crossoverzqj","email":"zqj1130123899@gmail.com"}],"description":"Dmzj's ESLint config.","homepage":"https://github.com/dmZhan/eslint-config","keywords":["eslint-config","antfu"],"author":{"name":"dmZhan","email":"zqj1130123899@gmail.com"},"license":"MIT","readme":"# @dmzj/eslint-config\n\n---\n\n> [!IMPORTANT]\n> This repository is a layer of encapsulation of @antfu/eslint-config. It is essentially the same as the original repository but includes some configurations that are better suited to my needs.\n\n- Global\n  - Always use `error` instead of `warn`\n- Vue\n  - Enforce the maximum number of attributes per line\n- JS/TS\n  - Enforce consistent brace style for all control statements\n\nFor more eslint configuration rules, see [`@antfu/eslint-config`](hhttps://github.com/antfu/eslint-config/blob/main/README.md).\n\n## Usage\n\n### Install\n\n```bash\npnpm i -D eslint @dmzj/eslint-config\n```\n\n### Create config file\n\nWith [`\"type\": \"module\"`](https://nodejs.org/api/packages.html#type) in `package.json` (recommended):\n\n```js\n// eslint.config.js\nimport dmzj from '@dmzj/eslint-config'\n\nexport default dmzj()\n```\n\nWith CJS:\n\n```js\n// eslint.config.js\nconst dmzj = require('@dmzj/eslint-config').default\n\nmodule.exports = dmzj()\n```\n\n> Note that `.eslintignore` no longer works in Flat config, see [customization](#customization) for more details.\n\n### Add script for package.json\n\nFor example:\n\n```json\n{\n  \"scripts\": {\n    \"lint\": \"eslint .\",\n    \"lint:fix\": \"eslint . --fix\"\n  }\n}\n```\n\n## VS Code support (auto fix)\n\nInstall [VS Code ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n\nAdd the following settings to your `.vscode/settings.json`:\n\n```jsonc\n{\n  // Enable the ESlint flat config support\n  \"eslint.experimental.useFlatConfig\": true,\n\n  // Disable the default formatter, use eslint instead\n  \"prettier.enable\": false,\n  \"editor.formatOnSave\": false,\n\n  // Auto fix\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll\": \"explicit\",\n    \"source.organizeImports\": \"never\"\n  },\n\n  // Silent the stylistic rules in you IDE, but still auto fix them\n  \"eslint.rules.customizations\": [\n    { \"rule\": \"style/*\", \"severity\": \"off\" },\n    { \"rule\": \"*-indent\", \"severity\": \"off\" },\n    { \"rule\": \"*-spacing\", \"severity\": \"off\" },\n    { \"rule\": \"*-spaces\", \"severity\": \"off\" },\n    { \"rule\": \"*-order\", \"severity\": \"off\" },\n    { \"rule\": \"*-dangle\", \"severity\": \"off\" },\n    { \"rule\": \"*-newline\", \"severity\": \"off\" },\n    { \"rule\": \"*quotes\", \"severity\": \"off\" },\n    { \"rule\": \"*semi\", \"severity\": \"off\" }\n  ],\n\n  // Enable eslint for all supported languages\n  \"eslint.validate\": [\n    \"javascript\",\n    \"javascriptreact\",\n    \"typescript\",\n    \"typescriptreact\",\n    \"vue\",\n    \"html\",\n    \"markdown\",\n    \"json\",\n    \"jsonc\",\n    \"yaml\"\n  ]\n}\n```\n\n## Customization\n\nYou only need to import the `dmzj` preset:\n\n```js\n// eslint.config.js\nimport dmzj from '@dmzj/eslint-config'\n\nexport default dmzj()\n```\n\nAnd that's it! Or you can configure each integration individually, for example:\n\n```js\n// eslint.config.js\nimport dmzj from '@dmzj/eslint-config'\n\nexport default dmzj({\n  // Enable stylistic formatting rules\n  // stylistic: true,\n\n  // Or customize the stylistic rules\n  stylistic: {\n    indent: 2, // 4, or 'tab'\n    quotes: 'single', // or 'double'\n  },\n\n  // TypeScript and Vue are auto-detected, you can also explicitly enable them:\n  typescript: true,\n  vue: true,\n\n  // Disable jsonc and yaml support\n  jsonc: false,\n  yaml: false,\n\n  // `.eslintignore` is no longer supported in Flat config, use `ignores` instead\n  ignores: [\n    './fixtures',\n    // ...globs\n  ]\n})\n```\n\nThe `dmzj` factory function also accepts any number of arbitrary custom config overrides:\n\n```js\n// eslint.config.js\nimport dmzj from '@dmzj/eslint-config'\n\nexport default dmzj(\n  {\n    // Configures for dmzj's config\n  },\n\n  // From the second arguments they are ESLint Flat Configs\n  // you can have multiple configs\n  {\n    files: ['**/*.ts'],\n    rules: {},\n  },\n  {\n    rules: {},\n  },\n)\n```\n\nGoing more advanced, you can also import fine-grained configs and compose them as you wish:\n\n<details>\n<summary>Advanced Example</summary>\n\nWe don't recommend using this style in general usages, as there are shared options between configs and might need extra care to make them consistent.\n\n```js\n// eslint.config.js\nimport {\n  comments,\n  ignores,\n  imports,\n  javascript,\n  jsdoc,\n  jsonc,\n  markdown,\n  node,\n  sortPackageJson,\n  sortTsconfig,\n  stylistic,\n  typescript,\n  unicorn,\n  vue,\n  yaml,\n} from '@dmzj/eslint-config'\n\nexport default [\n  ...ignores(),\n  ...javascript(/* Options */),\n  ...comments(),\n  ...node(),\n  ...jsdoc(),\n  ...imports(),\n  ...unicorn(),\n  ...typescript(/* Options */),\n  ...stylistic(),\n  ...vue(),\n  ...jsonc(),\n  ...yaml(),\n  ...markdown(),\n]\n```\n\n</details>\n\n### Lint Staged\n\nIf you want to apply lint and auto-fix before every commit, you can add the following to your `package.json`:\n\n```json\n{\n  \"simple-git-hooks\": {\n    \"pre-commit\": \"pnpm lint-staged\"\n  },\n  \"lint-staged\": {\n    \"*\": \"eslint --fix\"\n  }\n}\n```\n\nand then\n\n```bash\nnpm i -D lint-staged simple-git-hooks\n```\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}