@tapie-kr/code-guideline-react
Version:
TAPIE Code Style Standards - React Configuration
111 lines (108 loc) • 2.85 kB
JavaScript
// index.mjs
import baseConfig from "@tapie-kr/code-guideline-base";
import tsParser from "@typescript-eslint/parser";
// configs/format.mjs
import stylistic from "@stylistic/eslint-plugin";
var config = {
plugins: { "@stylistic": stylistic },
rules: {
"@stylistic/jsx-child-element-spacing": "off",
"@stylistic/jsx-closing-bracket-location": ["error", "line-aligned"],
"@stylistic/jsx-closing-tag-location": ["error", "line-aligned"],
"@stylistic/jsx-curly-brace-presence": [
"error",
{
props: "never",
children: "never",
propElementValues: "always"
}
],
"@stylistic/jsx-curly-newline": ["error", "consistent"],
"@stylistic/jsx-curly-spacing": [
"error",
"never",
{ allowMultiline: false }
],
"@stylistic/jsx-equals-spacing": ["error", "never"],
"@stylistic/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
"@stylistic/jsx-function-call-newline": ["error", "multiline"],
"@stylistic/jsx-indent": ["error", 2],
"@stylistic/jsx-indent-props": ["error", 2],
"@stylistic/jsx-max-props-per-line": "error",
"@stylistic/jsx-newline": [
"error",
{ prevent: true }
],
"@stylistic/jsx-one-expression-per-line": [
"error",
{ allow: "non-jsx" }
],
"@stylistic/jsx-pascal-case": [
"error",
{
allowAllCaps: true,
allowNamespace: true
}
],
"@stylistic/jsx-props-no-multi-spaces": "error",
"@stylistic/jsx-quotes": ["error", "prefer-single"],
"@stylistic/jsx-self-closing-comp": "error",
"@stylistic/jsx-sort-props": [
"error",
{
ignoreCase: true,
callbacksLast: true,
shorthandFirst: true,
multiline: "last",
noSortAlphabetically: true,
reservedFirst: true
}
],
"@stylistic/jsx-tag-spacing": [
"error",
{
closingSlash: "allow",
beforeClosing: "never"
}
],
"@stylistic/jsx-wrap-multilines": [
"error",
{
declaration: "parens-new-line",
assignment: "parens-new-line",
return: "parens-new-line",
arrow: "parens-new-line",
condition: "parens-new-line",
logical: "parens-new-line",
prop: "parens-new-line",
propertyValue: "parens"
}
]
}
};
var format_default = config;
// index.mjs
var config2 = [
{
files: ["**/*.{jsx,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: tsParser,
parserOptions: { ecmaFeatures: { jsx: true } }
},
settings: { react: { version: "detect" } }
},
{
ignores: [
"**/.next/**",
"**/next-env.d.ts"
]
},
...baseConfig,
format_default
];
var index_default = config2;
export {
index_default as default
};