eslint-config-toppro
v1.0.9
Published
[](https://travis-ci.com/topproio/eslint-config-toppro) []() [ => ({
test: /\.js$/,
loader: 'eslint-loader',
enforce: 'pre',
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: true,
}
})
module.exports = {
module: {
rules: [
createLintingRule(),
]
},
mode: 'development',
}
Gulp usage
To use it:
const eslint = require('gulp-eslint');
gulp.task('lint', () => {
gulp.src('*.js')
.pipe(eslint({
configFile: './.eslintrc.js'
}))
.pipe(eslint.format());
});
Wechat Miniprogram usage
Wechat miniprogram has some global variables, which have been configured.
globals: {
wx: true,
App: true,
Page: true,
getApp: true,
Component: true
}
Written in .eslintrc.js
:
module.exports = {
extends: ['toppro/weapp']
}
Vue usage
Npm with version greater than 3 will not be installed peerDependencies automatically. So if you didn't choose ESLint when building a vue project that you need to install the following dependencies.
npm i -D eslint babel-eslint eslint-loader eslint-plugin-html eslint-plugin-vue eslint-loader
Written in .eslintrc.js
:
module.exports = {
extends: ['toppro/vue']
}
React usage
We use eslint config of create-react-app. Please install:
npm i -D eslint babel-eslint eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-config-toppro eslint-config-react-app eslint-loader confusing-browser-globals
Written in .eslintrc.js
:
module.exports = {
extends: ['toppro/react']
}
Configuring ESLint
Disabling Rules with Inline Comments
Todo
- [X] Base rules: ES6, Node, Style and Variables
- [X] Wechat miniprogram: toppro/weapp
- [x] Vue
- [x] React
Update changelog
npm install -g conventional-changelog-cli
npm run changelog