6.0.0 • Published 3 months ago

@edwmurph/eslint-config v6.0.0

Weekly downloads
16
License
MIT
Repository
github
Last release
3 months ago

eslint-config

npm version

My JavaScript Styleguide for ESLint.

Install

npm install @edwmurph/eslint-config --save-dev

Usage

Use npm scripts to lint JS, e.g. npm run lint:

"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
}

alternatively if you are using the Vue config, you'll also need to tell eslint to look for .vue files:

"scripts": {
  "lint": "eslint . --ext .js,.vue",
  "lint:fix": "eslint . --fix --ext .js,.vue"
}

Add an .eslintrc.js file at the root of the repo extending the eslint config for the target project type

Node JS

module.exports = {
  root: true,
  extends: [
    '@edwmurph/eslint-config',
    // uncomment this if you are building a chrome extension
    // '@edwmurph/eslint-config/webextensions'
  ]
};

Gatsby JS

module.exports = {
  root: true,
  extends: [
    '@edwmurph/eslint-config/gatsby',
    // uncomment this if you are building a chrome extension
    // '@edwmurph/eslint-config/webextensions'
  ]
};

React

module.exports = {
  root: true,
  extends: [
    '@edwmurph/eslint-config/react',
    // uncomment this if you are building a chrome extension
    // '@edwmurph/eslint-config/webextensions'
  ]
};

NextJS

module.exports = {
  root: true,
  extends: [
    '@edwmurph/eslint-config/nextjs',
    // uncomment this if you are building a chrome extension
    // '@edwmurph/eslint-config/webextensions'
  ]
};

Vue 3

module.exports = {
  root: true,
  extends: [
    '@edwmurph/eslint-config/vue',
    // uncomment this if you are building a chrome extension
    // '@edwmurph/eslint-config/webextensions'
  ]
};

also for vue configs you need to update your lint scripts to look for vue files:

"scripts": {
  "lint": "eslint . --ext .js,.vue",
  "lint:fix": "eslint . --fix --ext .js,.vue"
}

also currently eslint@8 is not compatible with @vue/cli-plugin-eslint@4.5 so you may temporarilly need to workaround this by also installing an older verison of eslint via:

npm install -d eslint@6.7

tmp

6.0.1-rc.0

3 months ago

5.0.3

11 months ago

6.0.0

10 months ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

3.3.1

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

1.0.0

3 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago