2.10.4 • Published 8 months ago

@ocavue/eslint-config v2.10.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@ocavue/eslint-config

A set of ESLint shareable configs for TypeScript projects.

  • Out of the box support for TypeScript, React, and Markdown
  • Sort your imports
  • Sort your fields in package.json
  • Prefer top-level function declarations over function expressions

Install

$ npm install -D eslint prettier @ocavue/eslint-config

Usage

Config ESLint

You will need to use the new "flat" ESLint configuration (i.e. eslint.config.js).

In your eslint.config.js file, add the following to extend the basic config:

// eslint.config.js
import { basic } from '@ocavue/eslint-config'

export default [...basic()]

If you want to use the React config, you can do the following:

// eslint.config.js
import { basic, react } from '@ocavue/eslint-config'

export default [...basic(), ...react()]

If you want to use the Vue config, you can do the following:

// eslint.config.js
import { basic, vue } from '@ocavue/eslint-config'

export default [...basic(), ...vue()]

If you want to use the check the code blocks in markdown files, you can do the following:

// eslint.config.js
import { basic, markdown } from '@ocavue/eslint-config'

export default [...basic(), ...markdown()]

Add script for package.json

{
  "scripts": {
    "lint": "eslint .",
    "check": "prettier --check .",
    "fix": "eslint --fix . && prettier --write ."
  }
}

Add .prettierignore

Add a .prettierignore file in the root of your project. You can copy the .prettierignore file from this project.

VS Code integration

If you are using VS Code, you and install ESLint extension and Prettier extension, then add the following to your VS Code settings:

// .vscode/settings.json
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}

Inspired by

2.10.4

8 months ago

2.10.1

9 months ago

2.10.2

9 months ago

2.10.0

9 months ago

2.9.0

9 months ago

2.10.3

9 months ago

2.8.1

10 months ago

2.8.0

10 months ago

2.7.0

10 months ago

2.6.0

10 months ago

1.10.2

12 months ago

1.8.0

12 months ago

1.6.0

1 year ago

2.2.0

11 months ago

2.0.2

11 months ago

2.4.0

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.11.0

12 months ago

1.11.2

12 months ago

1.11.1

12 months ago

1.9.0

12 months ago

1.7.0

1 year ago

1.5.1

1 year ago

2.3.0

11 months ago

2.5.0

11 months ago

2.3.2

11 months ago

2.3.1

11 months ago

2.1.0

11 months ago

1.10.1

12 months ago

1.10.0

12 months ago

1.5.0

1 year ago

1.4.3

1 year ago

1.4.1

2 years ago

1.3.3

2 years ago

1.4.0

2 years ago

1.2.4-beta.4

2 years ago

1.2.4-beta.1

2 years ago

1.2.4-beta.0

2 years ago

1.2.4-beta.3

2 years ago

1.2.4-beta.2

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.5.0-beta.3

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.2

3 years ago