@lugia/eslint-config-mega
ESLint configuration used by Lugia.
React, JSX, ES6, TypeScript and Flow syntax support
Breaking changes in ESLint v6
Plugins and shareable configs are no longer affected by ESLint's location.
https://github.com/eslint/rfcs/pull/5
Inspired by:
Adding support for the following:
- eslint-plugin-prettier
- eslint-plugin-flowtype
- eslint-plugin-compat
- eslint-plugin-react
- eslint-formatter-pretty
- @typescript-eslint
- ......
Usage
- Install dependencies
yarn add --dev eslint @lugia/eslint-config-mega prettier
- Extend the config
// .eslintrc.json
{
"extends": "@lugia/mega"
}
Use eslint-formatter-pretty
yarn add --dev eslint-formatter-pretty
Use TypeScript
yarn add typescript
Lugia Mega
Which includes it by default.
ESLint CLI
eslint --format=pretty file.js
eslint-loader (webpack)
module.exports = {
module: {
rules: [
{
enforce: 'pre',
test: /\.(js|ts)x?$/,
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
formatter: require('eslint-formatter-pretty'),
},
},
],
},
};