{"id":18545749,"url":"https://github.com/icrawl/eslint-config-neon","last_synced_at":"2025-03-17T15:13:35.149Z","repository":{"id":58317413,"uuid":"531161101","full_name":"iCrawl/eslint-config-neon","owner":"iCrawl","description":"The ultimate ESLint shareable config","archived":false,"fork":false,"pushed_at":"2024-08-21T12:14:29.000Z","size":6775,"stargazers_count":56,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-16T07:31:18.268Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iCrawl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["icrawl"],"patreon":"iCrawl","open_collective":null,"ko_fi":"crawltogo","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-08-31T16:11:06.000Z","updated_at":"2024-09-25T08:40:41.000Z","dependencies_parsed_at":"2024-02-22T23:30:41.048Z","dependency_job_id":"5c579684-35ef-4d5c-9fc0-0168bb43baac","html_url":"https://github.com/iCrawl/eslint-config-neon","commit_stats":{"total_commits":76,"total_committers":7,"mean_commits":"10.857142857142858","dds":0.07894736842105265,"last_synced_commit":"fda7f6a2f2a4c0d739ccede81e372bd327971507"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCrawl%2Feslint-config-neon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCrawl%2Feslint-config-neon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCrawl%2Feslint-config-neon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iCrawl%2Feslint-config-neon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iCrawl","download_url":"https://codeload.github.com/iCrawl/eslint-config-neon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056424,"owners_count":20390719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T20:22:00.253Z","updated_at":"2025-03-17T15:13:35.128Z","avatar_url":"https://github.com/iCrawl.png","language":"TypeScript","funding_links":["https://github.com/sponsors/icrawl","https://patreon.com/iCrawl","https://ko-fi.com/crawltogo"],"categories":[],"sub_categories":[],"readme":"# Neon ESLint Config\n\n\u003cdiv align=\"center\"\u003e\n \u003cbr /\u003e\n \u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/eslint-config-neon\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/eslint-config-neon.svg?maxAge=3600\" alt=\"npm version\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/eslint-config-neon\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/eslint-config-neon.svg?maxAge=3600\" alt=\"npm downloads\" /\u003e\u003c/a\u003e\n \u003c/p\u003e\n\u003c/div\u003e\n\n## Installation\n\nneon comes as a complete package, none of the configs require any additional dependecies.\n\n```sh-session\nnpm install eslint eslint-config-neon\nyarn add eslint eslint-config-neon\npnpm add eslint eslint-config-neon\n```\n\n## Usage\n\nThis package includes the following configurations:\n\n- [`eslint-config-neon/common`](./src/common.ts) – The neon code style guide.\n- [`eslint-config-neon/angular`](./src/angular.ts) – for usage with [Angular](https://angular.io/).\n- [`eslint-config-neon/astro`](./src/astro.ts) – for usage with [Astro](https://astro.build/).\n- [`eslint-config-neon/browser`](./src/browser.ts) – for usage with DOM and other browser APIs.\n- [`eslint-config-neon/cypress`](./src/cypress.ts) – for usage with [Cypress](https://cypress.io/).\n- [`eslint-config-neon/edge`](./src/edge.ts) – for usage with an edge runtime [Vercel](https://vercel.com/blog/introducing-the-edge-runtime), [Cloudflare Workers](https://workers.cloudflare.com/), or others.\n- [`eslint-config-neon/jsx`](./src/jsx.ts) – for usage with [JSX](https://reactjs.org/docs/introducing-jsx.html) (with or without [React](https://reactjs.org/)).\n- [`eslint-config-neon/jsx-a11y`](./src/jsx-a11y.ts) – for usage with [JSX](https://facebook.github.io/react/) (with or without [React](https://reactjs.org/)) and want to include [accessibility checks](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y).\n- [`eslint-config-neon/module`](./src/module.ts) – for usage with ESM modules.\n- [`eslint-config-neon/next`](./src/next.ts) – for usage with [Next.js](https://nextjs.org/).\n- [`eslint-config-neon/no-deprecated`](./src/no-deprecated.ts) - for reporting deprecated APIs (very slow on big repos, especially monorepos).\n- [`eslint-config-neon/node`](./src/node.ts) – for usage with Node.js.\n- [`eslint-config-neon/prettier`](./src/prettier.ts) – for usage with [Prettier](https://prettier.io/).\n- [`eslint-config-neon/react`](./src/react.ts) – for usage with [React](https://reactjs.org/).\n- [`eslint-config-neon/rxjs`](./src/rxjs.ts) – for usage with [RxJS](https://rxjs.dev/).\n- [`eslint-config-neon/rxjs-angular`](./src/rxjs-angular.ts) – for usage [RxJS](https://rxjs.dev/) and [Angular](https://angular.io/).\n- [`eslint-config-neon/svelte`](./src/svelte.ts) – for usage with [Svelte](https://svelte.dev/).\n- [`eslint-config-neon/svelte-typescript`](./src/svelte-typescript.ts) – for usage with [Svelte](https://svelte.dev/) and [TypeScript](http://typescriptlang.org/).\n- [`eslint-config-neon/typescript`](./src/typescript.ts) – for usage with [TypeScript](http://typescriptlang.org/).\n- [`eslint-config-neon/vue`](./src/vue.ts) – for usage with [Vue](https://vuejs.org/).\n- [`eslint-config-neon/vue-typescript`](./src/vue-typescript.ts) – for usage with [Vue](https://vuejs.org/) and [TypeScript](http://typescriptlang.org/).\n\n### Notes\n\n#### Flat Config only\n\nIt is important to note that this package only exports [ESLint Flat Config][]! This means that you _have_ to use `eslint.config.js`, `eslint.config.mjs`, or `eslint.config.cjs` to use this package. See the ESLint documentation on flat config for more information.\n\n#### Importing Configs\n\nInstead of importing from `eslint-config-neon`, you can also import each individual config from subpaths, e.g.\n\n```ts\nimport common from \"eslint-config-neon/common\";\n```\n\ninstead of\n\n```ts\nimport { common } from \"eslint-config-neon\";\n```\n\n#### Merging Configs\n\nIn the examples below you will often see `lodash.merge` being used. This is of vital importance as objects often have to be deeply merged when using ESLint Flat Config. If you don't merge the objects, you will overwrite the previous object with the new one, and your config will be invalid.\n\nThis package ships ships a transient dependency to `lodash.merge` and `@types/lodash.merge` to make sure it is available in your project.\n\n#### Reducing downloaded bundle size\n\nBecause this eslint config has a lot of transient dependencies to offer different eslint configs the bundle size of this package will be quite large. To alleviate this somewhat you can configure your package manager to skip the dependencies that you do not need through the `resolutions` (yarn) or `overrides` (npm / pnpm) fields.\n\nFollowing is an example of excluding `eslint-plugin-vue`, which you can safely do if you're not using `eslint-config-neon/vue` nor `eslint-config-neon/vue-typescript`.\n\n**Yarn**\n\n```json\n{\n\t\"resolutions\": {\n\t\t\"eslint-plugin-vue\": \"npm:@favware/skip-dependency@latest\"\n\t}\n}\n```\n\n**Pnpm** and **npm**\n\n```json\n{\n\t\"overrides\": {\n\t\t\"eslint-plugin-vue\": \"npm:@favware/skip-dependency@latest\"\n\t}\n}\n```\n\n### Configuration\n\n```js\nimport { common, typescript, prettier } from \"eslint-config-neon\";\n\nexport default [\n\t{\n\t\tignore: [\"**/dist/*\"],\n\t},\n\t...common,\n\t...typescript,\n\t...prettier,\n\t{\n\t\tlanguageOptions: {\n\t\t\tproject: \"./tsconfig.json\",\n\t\t},\n\t},\n];\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eNode.js\u003c/summary\u003e\n\u003cbr\u003e\n\n```js\nimport { common, prettier, typescript } from \"eslint-config-neon\";\nimport merge from \"lodash.merge\";\n\n/**\n * @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray}\n */\nconst config = [\n\t...[...common, ...typescript, ...prettier].map((config) =\u003e\n\t\tmerge(config, {\n\t\t\tfiles: [\"src/**/*.ts\"],\n\t\t\tlanguageOptions: {\n\t\t\t\tparserOptions: {\n\t\t\t\t\tproject: \"tsconfig.eslint.json\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t),\n];\n\nexport default config;\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eReact / Next\u003c/summary\u003e\n\u003cbr\u003e\n\nReact:\n\n```js\nimport { common, browser, node, typescript, react, edge, prettier } from \"eslint-config-neon\";\n\nexport default [\n\t{\n\t\tignore: [\"**/dist/*\"],\n\t},\n\t...common,\n\t...browser,\n\t...node,\n\t...typescript,\n\t...react,\n\t...edge,\n\t...prettier,\n\t{\n\t\tsettings: {\n\t\t\treact: {\n\t\t\t\tversion: \"detect\",\n\t\t\t},\n\t\t},\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.json\",\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t\"react/react-in-jsx-scope\": 0,\n\t\t\t\"react/jsx-filename-extension\": [1, { extensions: [\".tsx\"] }],\n\t\t},\n\t},\n];\n```\n\nNext:\n\nNote: For Vite this is the same setup, just exclude the next config.\n\n```js\nimport { browser, common, edge, next, node, prettier, react, typescript } from \"eslint-config-neon\";\nimport merge from \"lodash.merge\";\n\n/**\n * @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray}\n */\nconst config = [\n\t...[...common, ...browser, ...node, ...typescript, ...react, ...next, ...edge, ...prettier].map((config) =\u003e\n\t\tmerge(config, {\n\t\t\tfiles: [\"src/**/*.ts\"],\n\t\t\tsettings: {\n\t\t\t\treact: {\n\t\t\t\t\tversion: \"detect\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tlanguageOptions: {\n\t\t\t\tparserOptions: {\n\t\t\t\t\tproject: \"tsconfig.json\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t),\n];\n\nexport default config;\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAstro\u003c/summary\u003e\n\u003cbr\u003e\n\n```js\nimport { common, browser, node, typescript, react, astro, prettier } from \"eslint-config-neon\";\n\nexport default [\n\t{\n\t\tignore: [\"**/dist/*\"],\n\t},\n\t...common,\n\t...browser,\n\t...node,\n\t...typescript,\n\t...react,\n\t...astro,\n\t...prettier,\n\t{\n\t\tsettings: {\n\t\t\treact: {\n\t\t\t\tversion: \"detect\",\n\t\t\t},\n\t\t},\n\t\tlanguageOptions: {\n\t\t\tproject: \"./tsconfig.json\",\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.json\",\n\t\t\t},\n\t\t},\n\t\trules: {\n\t\t\t\"react/jsx-filename-extension\": [1, { extensions: [\".tsx\"] }],\n\t\t},\n\t},\n];\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVue 2/3 / Nuxt\u003c/summary\u003e\n\u003cbr\u003e\n\n```js\nimport { common, browser, node, typescript, vue, vuetypescript, prettier } from \"eslint-config-neon\";\n\nexport default [\n\t{\n\t\tignore: [\"**/dist/*\"],\n\t},\n\t...common,\n\t...browser,\n\t...node,\n\t...typescript,\n\t...vue,\n\t...vuetypescript,\n\t...prettier,\n\t{\n\t\tlanguageOptions: {\n\t\t\tparserOptions: {\n\t\t\t\tproject: \"./tsconfig.json\",\n\t\t\t},\n\t\t},\n\t},\n];\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAngular / NX\u003c/summary\u003e\n\u003cbr\u003e\n\n```js\nimport { angular, browser, common, node, prettier, rxjs, rxjsangular, typescript } from \"eslint-config-neon\";\nimport merge from \"lodash.merge\";\n\n/**\n * @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray}\n */\nconst config = [\n\t...[...common, ...browser, ...node, ...typescript, ...angular, ...rxjs, ...rxjsangular, ...prettier].map((config) =\u003e\n\t\tmerge(config, {\n\t\t\tfiles: [\"src/**/*.ts\"],\n\t\t\tlanguageOptions: {\n\t\t\t\tparserOptions: {\n\t\t\t\t\tproject: \"tsconfig.json\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t),\n\t...angular.map((config) =\u003e\n\t\tmerge(config, {\n\t\t\tfiles: [\"src/**/*.html\"],\n\t\t\tlanguageOptions: {\n\t\t\t\tparserOptions: {\n\t\t\t\t\tproject: \"tsconfig.json\",\n\t\t\t\t},\n\t\t\t},\n\t\t}),\n\t),\n];\n\nexport default config;\n```\n\n\u003cbr\u003e\n\u003c/details\u003e\n\n### Usage with Prettier\n\nPrettier and neon are already compatible. Just add it as the last config in your `extends` configuration, e.g.\n\n```js\nimport { prettier } from \"eslint-config-neon\";\n\nexport default [...prettier];\n```\n\nThis configuration disables all neon rules that conflict with Prettier.\n\n[ESLint Flat Config]: https://eslint.org/blog/2022/08/new-config-system-part-2/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficrawl%2Feslint-config-neon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficrawl%2Feslint-config-neon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficrawl%2Feslint-config-neon/lists"}