mirror of
https://github.com/rjNemo/react_template
synced 2026-06-06 07:56:41 +00:00
set prettier and eslint
This commit is contained in:
parent
f8d1727f9d
commit
4a478b67ba
5 changed files with 40 additions and 9 deletions
23
.eslintrc.js
Normal file
23
.eslintrc.js
Normal file
|
|
@ -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",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptSettings">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="JSX" />
|
<option name="languageLevel" value="FLOW" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
7
.idea/prettier.xml
Normal file
7
.idea/prettier.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PrettierConfiguration">
|
||||||
|
<option name="myRunOnSave" value="true" />
|
||||||
|
<option name="myRunOnReformat" value="true" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
5
.prettierrc.js
Normal file
5
.prettierrc.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
module.exports = {
|
||||||
|
semi: true,
|
||||||
|
trailingComma: 'none',
|
||||||
|
singleQuote: true
|
||||||
|
};
|
||||||
12
src/App.tsx
12
src/App.tsx
|
|
@ -1,11 +1,7 @@
|
||||||
import React from 'react';
|
import React, { FC } from "react";
|
||||||
|
|
||||||
const App = () =>{
|
const App: FC = () => {
|
||||||
return (
|
return <div>Hello</div>;
|
||||||
<div >
|
};
|
||||||
Hello
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue