From 4a478b67ba93804d48457587cb65f166d767e5fe Mon Sep 17 00:00:00 2001 From: Ruidy Date: Thu, 22 Oct 2020 13:59:00 +0200 Subject: [PATCH] set prettier and eslint --- .eslintrc.js | 23 +++++++++++++++++++++++ .idea/misc.xml | 2 +- .idea/prettier.xml | 7 +++++++ .prettierrc.js | 5 +++++ src/App.tsx | 12 ++++-------- 5 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .eslintrc.js create mode 100644 .idea/prettier.xml create mode 100644 .prettierrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..1bfa3ae --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,23 @@ +module.exports = { + parser: "@typescript-eslint/parser", // Specifies the ESLint parser + parserOptions: { + ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features + sourceType: "module", // Allows for the use of imports + ecmaFeatures: { + jsx: true // Allows for the parsing of JSX + } + }, + settings: { + react: { + version: "detect" // Tells eslint-plugin-react to automatically detect the version of React to use + } + }, + extends: [ + "plugin:react/recommended", // Uses the recommended rules from @eslint-plugin-react + "plugin:@typescript-eslint/recommended" // Uses the recommended rules from @typescript-eslint/eslint-plugin + ], + rules: { + // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs + // e.g. "@typescript-eslint/explicit-function-return-type": "off", + }, +}; \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 24eb271..3668dc8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 0000000..727b8b5 --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..9e20e24 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + semi: true, + trailingComma: 'none', + singleQuote: true +}; diff --git a/src/App.tsx b/src/App.tsx index 2c58953..ebe8cd0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,7 @@ -import React from 'react'; +import React, { FC } from "react"; -const App = () =>{ - return ( -
- Hello -
- ); -} +const App: FC = () => { + return
Hello
; +}; export default App;