Name: eslint-config-alloy
Owner: ?? AlloyTeam
Description: AlloyTeam ESLint ??
Created: 2017-06-14 13:52:32.0
Updated: 2018-05-24 07:54:21.0
Pushed: 2018-05-07 07:22:03.0
Homepage: https://alloyteam.github.io/eslint-config-alloy/
Size: 274
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
????????????https://alloyteam.github.io/eslint-config-alloy/
?? | ???? | ??? — | — | — ???? | ESLint ?? | babel-eslint React | ESLint ???eslint-plugin-react | babel-eslint Vue | ESLint ???eslint-plugin-vue | vue-eslint-parser@2.0.1-beta.2 babel-eslint TypeScript | ESLint ???eslint-plugin-typescript | typescript-eslint-parser TypeScript React | ESLint ???eslint-plugin-typescript?eslint-plugin-react | typescript-eslint-parser
?????????????? ESLint ???????????????????ESLint ???
????????????????????????????????????????????????????????????
@off
???@autofix
???
install --save-dev eslint babel-eslint eslint-config-alloy
??????????? .eslintrc.js
??????????????
le.exports = {
extends: [
'eslint-config-alloy',
],
globals: {
// ???????????????
// ???? false ????????????????????
//
// jQuery: false,
// $: false
},
rules: {
// ????????????????????
//
// // @fixable ?????????????
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ]
}
???
install --save-dev eslint babel-eslint eslint-plugin-react eslint-config-alloy
??????????? .eslintrc.js
??????????????
le.exports = {
extends: [
'eslint-config-alloy/react',
],
globals: {
// ???????????????
// ???? false ????????????????????
//
// React: false,
// ReactDOM: false
},
rules: {
// ????????????????????
//
// // @fixable ?????????????
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ],
// // @fixable jsx ? children ?????????
// 'react/jsx-indent': [
// 'error',
// 2
// ],
// // @fixable jsx ? props ?????????
// 'react/jsx-indent-props': [
// 'error',
// 2
// ]
}
???
install --save-dev eslint babel-eslint vue-eslint-parser@2.0.1-beta.2 babel-eslint eslint-plugin-vue@3 eslint-config-alloy
??????????? .eslintrc.js
??????????????
le.exports = {
extends: [
'eslint-config-alloy/vue',
],
globals: {
// ???????????????
// ???? false ????????????????????
//
// Vue: false
},
rules: {
// ????????????????????
//
// // @fixable ?????????????
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ]
}
???
install --save-dev eslint typescript typescript-eslint-parser eslint-plugin-typescript eslint-config-alloy
??????????? .eslintrc.js
??????????????
le.exports = {
extends: [
'eslint-config-alloy/typescript',
],
globals: {
// ???????????????
// ???? false ????????????????????
//
// jQuery: false,
// $: false
},
rules: {
// ????????????????????
//
// // @fixable ?????????????
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ]
}
???
install --save-dev eslint typescript typescript-eslint-parser eslint-plugin-typescript eslint-plugin-react eslint-config-alloy
??????????? .eslintrc.js
??????????????
le.exports = {
extends: [
'eslint-config-alloy/typescript-react',
],
globals: {
// ???????????????
// ???? false ????????????????????
//
// React: false,
// ReactDOM: false
},
rules: {
// ????????????????????
//
// // @fixable ?????????????
// 'indent': [
// 'error',
// 2,
// {
// SwitchCase: 1,
// flatTernaryExpressions: true
// }
// ]
}
? VSCode ???? ESLint ????? .vue
?.ts
? .tsx
????????? => ??? => ??????????
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
"vue",
"typescript",
"typescriptreact"
]
?????? .vue
?.ts
? .tsx
???? ESLint ? autoFix????????
"eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
{
"language": "vue",
"autoFix": true
},
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
]
test