AlloyTeam/eslint-config-alloy

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

AlloyTeam ESLint ??

Build Status npm package npm downloads

????????????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 ???

  1. ??????????????????
  2. ???????????????????????
  3. ???????????????????????
????

????????????????????????????????????????????????????????????

????
????

???

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
    //     }
    // ]
}

React

???

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
    // ]
}

Vue

???

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
    //     }
    // ]
}

TypeScript

???

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
    //     }
    // ]
}

TypeScript React

???

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
    //     }
    // ]
}

Troubleshootings
? VSCode ???

? VSCode ???? ESLint ????? .vue?.ts ? .tsx ????????? => ??? => ??????????


"eslint.validate": [
    "javascript",
    "javascriptreact",
    "html",
    "vue",
    "typescript",
    "typescriptreact"
]

VSCode ?? autoFixOnSave ????

?????? .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
    }
]

Testing
test
??

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.