eslint

eslint

--fixreact

https://eslint.org/docs/user-guide/command-line-interface#fixing-problemsgit

--ignore-patterngithub

https://eslint.org/docs/user-guide/command-line-interface#ignoring-filesjson


eslint object trailing comma

[eslint] Unexpected trailing comma.curl

https://eslint.org/docs/rules/comma-style
https://eslint.org/docs/rules/comma-dangleide

https://eslint.org/docs/rules/object-curly-newlineui

{
    // "comma-dangle": ["error", {
    //     "objects": "never",
    // }],
    // "comma-style": ["none", "last", {"exceptions": { "ArrayExpression": true, "ObjectExpression": true }}],
    'comma-dangle': [ERROR, 'always-multiline'],
}

https://github.com/facebook/react/blob/master/.eslintrc.jsurl

{
    "comma-dangle": ["error", "never"],
    // or
    "comma-dangle": ["error", {
        "arrays": "never",
        "objects": "never",
        "imports": "never",
        "exports": "never",
        "functions": "ignore"
    }]
}

https://eslint.org/docs/rules/comma-dangle#alwayseslint

{
    "comma-dangle": ["error", "always"],
    // or
    "comma-dangle": ["error", {
        "arrays": "always",
        "objects": "always-multiline",
        "imports": "never",
        "exports": "never",
        "functions": "ignore"
    }]
}

https://eslint.org/docs/rules/code

相關文章
相關標籤/搜索