Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edwmurph/eslint-config
My JavaScript Styleguide for ESLint
https://github.com/edwmurph/eslint-config
eslint eslint-config gatsbyjs react vue
Last synced: 23 days ago
JSON representation
My JavaScript Styleguide for ESLint
- Host: GitHub
- URL: https://github.com/edwmurph/eslint-config
- Owner: edwmurph
- License: mit
- Created: 2020-07-11T11:43:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-11T01:50:49.000Z (12 months ago)
- Last Synced: 2024-12-15T12:46:01.608Z (about 1 month ago)
- Topics: eslint, eslint-config, gatsbyjs, react, vue
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# eslint-config
[![npm version](https://badge.fury.io/js/%40edwmurph%2Feslint-config.svg)](https://badge.fury.io/js/%40edwmurph%2Feslint-config)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`:
```json
"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:
```json
"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
```javascript
module.exports = {
root: true,
extends: [
'@edwmurph/eslint-config',
// uncomment this if you are building a chrome extension
// '@edwmurph/eslint-config/webextensions'
]
};
```### Gatsby JS
```javascript
module.exports = {
root: true,
extends: [
'@edwmurph/eslint-config/gatsby',
// uncomment this if you are building a chrome extension
// '@edwmurph/eslint-config/webextensions'
]
};
```### React
```javascript
module.exports = {
root: true,
extends: [
'@edwmurph/eslint-config/react',
// uncomment this if you are building a chrome extension
// '@edwmurph/eslint-config/webextensions'
]
};
```### NextJS
```javascript
module.exports = {
root: true,
extends: [
'@edwmurph/eslint-config/nextjs',
// uncomment this if you are building a chrome extension
// '@edwmurph/eslint-config/webextensions'
]
};
```### Vue 3
```javascript
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:
```json
"scripts": {
"lint": "eslint . --ext .js,.vue",
"lint:fix": "eslint . --fix --ext .js,.vue"
}
```also currently eslint@8 is [not compatible](https://github.com/vuejs/vue-cli/issues/6759) with @vue/[email protected] so you may temporarilly need to workaround this by also installing an older verison of eslint via:
```bash
npm install -d [email protected]
```