Chowa project javascript and typescript syntax standard
npm i eslint-plugin-chowa-standard --save-dev
If you don't have eslint installed
npm i eslint eslint-loader eslint-friendly-formatter --save-dev
module.exports = {
module: {
rules: [{
test: /\.(j|t)sx?$/,
enforce: 'pre',
use: [
{
loader: 'eslint-loader',
options: {
emitWarning: true,
emitError: true,
formatter: require('eslint-friendly-formatter')
}
}
]
}]
}
}
{
extends: [
'plugin:chowa-standard/recommended'
]
}
npm i eslint-plugin-react --save-dev
{
extends: [
'plugin:react/recommended',
'plugin:chowa-standard/recommended'
],
plugins: [
'react'
],
env: {
node: false,
browser: true,
es6: true
},
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
jsx: true
},
settings: {
react: {
pragma: 'React',
version: 'detect'
}
}
}
npm i @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
{
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:chowa-standard/recommended'
],
plugins: [
'@typescript-eslint'
],
env: {
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
}
}