@tapie-kr/code-guideline-react
Version:
TAPIE Code Style Standards - React Configuration
141 lines (137 loc) • 4.45 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// index.mjs
var index_exports = {};
__export(index_exports, {
default: () => index_default
});
module.exports = __toCommonJS(index_exports);
var import_code_guideline_base = __toESM(require("@tapie-kr/code-guideline-base"), 1);
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
// configs/format.mjs
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
var config = {
plugins: { "@stylistic": import_eslint_plugin.default },
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: import_parser.default,
parserOptions: { ecmaFeatures: { jsx: true } }
},
settings: { react: { version: "detect" } }
},
{
ignores: [
"**/.next/**",
"**/next-env.d.ts"
]
},
...import_code_guideline_base.default,
format_default
];
var index_default = config2;