From 6fa8990f3d3fbeb97d4d900b9c49cb01cd934aa7 Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Sun, 16 Oct 2022 20:38:46 +0630 Subject: [PATCH] chore: configure eslint and prettier --- .eslintrc.json | 38 ++++++++++++++++++++++++++++++++++++++ .prettierignore | 11 +++++++++++ .prettierrc | 11 +++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .prettierignore create mode 100644 .prettierrc diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..66c79e1 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,38 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "ignorePatterns": ["node_modules", "dist"], + "plugins": ["react", "@typescript-eslint", "react-hooks", "prettier"], + "rules": { + "react/react-in-jsx-scope": "off", + "react/no-unescaped-entities": 0, + "react/prop-types": 0, + "camelcase": "error", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "error", + "no-duplicate-imports": "error", + "linebreak-style": ["warn", "unix"] + }, + "settings": { + "react": { + "version": "detect" + }, + "import/resolver": { + "typescript": {} + } + } +} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6056347 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +# Ignore everything +/* + +# Except these files & folders +!/src +!/.github +!tsconfig.json +!astro.config.mjs +!package.json +!.prettierrc +!.eslintrc.json \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..1a5b843 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "arrowParens": "avoid", + "semi": true, + "tabWidth": 2, + "printWidth": 80, + "singleQuote": false, + "jsxSingleQuote": false, + "trailingComma": "es5", + "bracketSpacing": true, + "endOfLine": "lf" +}