Package Exports
- @pequity/eslint-config
- @pequity/eslint-config/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@pequity/eslint-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@pequity/eslint-config
Custom ESLint and Prettier config with sensible defaults
Installation
npm i -D @pequity/eslint-config eslint prettierUsage
There are 4 ESLint config presets that you can use:
@pequity/eslint-config/javascriptfor JavaScript / TypeScript projects@pequity/eslint-config/vue2for Vue.js 2 projects@pequity/eslint-config/vue3for Vue.js 3 projects@pequity/eslint-config/vue3-typescriptfor Vue.js 3 / TypeScript projects
Add the desired config preset into your .eslintrc.js file:
module.exports = {
extends: ['@pequity/eslint-config/vue2']
};Add a prettier.config.js file with contents:
module.exports = require('@pequity/eslint-config/prettier.config.js');You can add ESLint commands to .package-json
{
"lint": "eslint \"**/*.{vue,ts,js}\"",
"lint-fix": "eslint --fix \"**/*.{vue,ts,js}\""
}and VS Code settings for autofix on save
.vscode/settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}Features
- Based on eslint-config-standard
- Prettier for code formatting
- Plugins
- eslint-plugin-html for linting inline scripts contained in HTML files
- eslint-plugin-vue for linting Vue.js files
- eslint-config-prettier for disabling all rules that conflict with Prettier
- eslint-plugin-prettier for using prettier as a code formatter for
eslint --fix - sort-imports-es6-autofix for auto-fixing imports order