eslint-config-neon

0.1.57 • Public • Published

Neon ESLint Config


npm version npm downloads

Installation

neon comes as a complete package, none of the configs require any additional dependecies.

npm install eslint eslint-config-neon
yarn add eslint eslint-config-neon
pnpm add eslint eslint-config-neon

Usage

This package includes the following configurations:

Configuration

{
	"root": true,
	"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"],
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"]
}
Node.js
{
	"root": true,
	"root": true,
	"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"],
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"]
}

React / Next

React:

{
	"root": true,
	"extends": [
		"neon/common",
		"neon/browser",
		"neon/node",
		"neon/typescript",
		"neon/react",
		"neon/next",
		"neon/edge",
		"neon/prettier"
	],
	"settings": {
		"react": {
			"version": "detect"
		}
	},
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"],
	"rules": {
		"react/react-in-jsx-scope": 0,
		"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }]
	}
}

Next:

{
	"root": true,
	"extends": [
		"neon/common",
		"neon/browser",
		"neon/node",
		"neon/typescript",
		"neon/react",
		"neon/next",
		"neon/edge",
		"neon/prettier"
	],
	"settings": {
		"react": {
			"version": "detect"
		}
	},
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"],
	"rules": {
		"react/react-in-jsx-scope": 0,
		"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }]
	}
}

Astro
{
	"root": true,
	"extends": [
		"neon/common",
		"neon/browser",
		"neon/node",
		"neon/typescript",
		"neon/react",
		"neon/astro",
		"neon/prettier"
	],
	"settings": {
		"react": {
			"version": "detect"
		}
	},
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"],
	"rules": {
		"react/jsx-filename-extension": [1, { "extensions": [".tsx", ".astro"] }]
	}
}

Vue 2/3 / Nuxt
{
	"root": true,
	"extends": [
		"neon/common",
		"neon/browser",
		"neon/node",
		"neon/typescript",
		"neon/vue",
		"neon/vue-typescript",
		"neon/prettier"
	],
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["**/dist/*"]
}

Angular / NX
{
	"root": true,
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"ignorePatterns": ["!**/*"],
	"overrides": [
		{
			"files": ["*.ts"],
			"extends": [
				"neon/common",
				"neon/browser",
				"neon/node",
				"neon/typescript",
				"neon/angular",
				"neon/rxjs",
				"neon/rxjs-angular",
				"neon/prettier"
			]
		},
		{
			"files": ["*.html"],
			"extends": ["neon/angular"]
		}
	]
}

Usage with Prettier

Prettier and neon are already compatible. Just add it as the last config in your extends configuration, e.g.

{
	"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"]
}

This configuration disables all neon rules that conflict with Prettier.

Package Sidebar

Install

npm i eslint-config-neon

Weekly Downloads

586

Version

0.1.57

License

Apache-2.0

Unpacked Size

84.8 kB

Total Files

70

Last publish

Collaborators

  • crawl