Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relaxxpls/eslint-config-web
Opinionated ESLint configuration for linting JavaScript code.
https://github.com/relaxxpls/eslint-config-web
config configuration eslint eslint-config hacktoberfest javascript
Last synced: about 1 month ago
JSON representation
Opinionated ESLint configuration for linting JavaScript code.
- Host: GitHub
- URL: https://github.com/relaxxpls/eslint-config-web
- Owner: relaxxpls
- License: mit
- Created: 2022-04-23T11:12:11.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T11:10:53.000Z (about 1 year ago)
- Last Synced: 2024-12-19T22:39:09.805Z (about 2 months ago)
- Topics: config, configuration, eslint, eslint-config, hacktoberfest, javascript
- Language: JavaScript
- Homepage: https://github.com/relaxxpls/eslint-config-web/blob/master/README.md
- Size: 3.46 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Plug N Play ESLint and Prettier Setup for Web Dev
These are my settings for ESLint and Prettier. They're fully customizable (incase you dont like them).
[![Version](https://img.shields.io/npm/v/eslint-config-web.svg)](https://www.npmjs.com/package/eslint-config-web)
[![SourceRank](https://img.shields.io/librariesio/sourcerank/npm/eslint-config-web)](https://www.npmjs.com/package/eslint-config-web)
[![license](https://img.shields.io/github/license/relaxxpls/eslint-config-web)](https://github.com/relaxxpls/eslint-config-web/blob/master/LICENSE)## Installation
```bash
npm install --dev eslint prettier eslint-config-web
# or
yarn add --dev eslint prettier eslint-config-web
```## Usage
### Javascript
Create a `.eslintrc.js` file in the root of your project's directory (it should live where package.json does). Your `.eslintrc.js` file should look like this:
```js
module.exports = {
extends: [
"eslint-config-web",
],
};
```### TypeScript
Create a `.eslintrc.js` file in the root of your project's directory (it should live where package.json does). Your `.eslintrc.js` file should look like this:
```js
module.exports = {
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
extends: [
"eslint-config-web/typescript",
],
};
```TypeScript users will also need a `tsconfig.json` file in their project.
An empty object (`{}`) will do if this is a new project.## JavaScript + TypeScript
If you have both `.js` and `.ts` files in your project, you can use the following config to use the typescript rules only on `.ts` files.
```js
module.exports = {
extends: ["eslint-config-web"],
overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
},
extends: ["eslint-config-web/typescript"],
},
],
};
```