Last active
May 1, 2021 18:28
-
-
Save robertov8/4d04e5b64937f6fef21cfebc0a16a29c to your computer and use it in GitHub Desktop.
create-react-app + eslint + prettier + typescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add eslint -D | |
yarn add prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
end_of_line = lf | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
trim_trailing_whitespace = false | |
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'plugin:prettier/recommended', | |
'prettier/react', | |
], | |
globals: { | |
Atomics: 'readonly', | |
SharedArrayBuffer: 'readonly', | |
}, | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, | |
ecmaVersion: 2018, | |
sourceType: 'module', | |
}, | |
plugins: ['react', 'prettier', 'react-hooks'], | |
rules: { | |
'prettier/prettier': 'error', | |
'import/prefer-default-export': 'off', | |
'no-param-reassing': 'off', | |
'no-console': ['error', { allow: ['tron'] }], | |
'react-hooks/rules-of-hooks': 'error', | |
'react-hooks/exhaustive-deps': 'warn', | |
'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.js', '.tsx', '.ts'] }], | |
'import/extensions': 'off' | |
}, | |
settings: { | |
'import/resolver': { | |
node: { | |
'extensions': ['.js', '.jsx', '.ts', '.tsx'] | |
} | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"singleQuote": true, | |
"endOfLine": "lf", | |
"trailingComma": "es5", | |
"tabWidth": 2, | |
"semi": true, | |
"useTabs": false, | |
"arrowParens": "avoid", | |
"jsxBracketSameLine": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createGlobalStyle } from 'styled-components'; | |
export default createGlobalStyle` | |
* { | |
margin: 0; | |
padding: 0; | |
outline: 0; | |
box-sizing: border-box; | |
} | |
html, body, #root { | |
min-height: 100%; | |
} | |
body { | |
-webkit-font-smoothing: antialiased !important; | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "backend", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"scripts": { | |
"start": "nodemon --delay 1500ms src/index.js" | |
}, | |
"dependencies": { | |
"cors": "^2.8.5", | |
"express": "^4.17.1", | |
"knex": "^0.20.13", | |
"sqlite3": "^4.1.1" | |
}, | |
"devDependencies": { | |
"@types/express": "^4.17.3", | |
"@types/knex": "^0.16.1", | |
"nodemon": "^2.0.2", | |
"prettier": "^2.0.2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "modulo07", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@testing-library/jest-dom": "^4.2.4", | |
"@testing-library/react": "^9.3.2", | |
"@testing-library/user-event": "^7.1.2", | |
"eslint-plugin-react-hooks": "^2.5.0", | |
"react": "^16.13.0", | |
"react-dom": "^16.13.0", | |
"react-scripts": "3.4.0" | |
}, | |
"scripts": { | |
"start": "react-scripts start", | |
"build": "react-scripts build", | |
"test": "react-scripts test", | |
"eject": "react-scripts eject" | |
}, | |
"eslintConfig": { | |
"extends": "react-app" | |
}, | |
"browserslist": { | |
"production": [ | |
">0.2%", | |
"not dead", | |
"not op_mini all" | |
], | |
"development": [ | |
"last 1 chrome version", | |
"last 1 firefox version", | |
"last 1 safari version" | |
] | |
}, | |
"devDependencies": { | |
"eslint": "^6.8.0", | |
"eslint-config-prettier": "^6.10.0", | |
"eslint-plugin-prettier": "^3.1.2", | |
"eslint-plugin-react": "^7.19.0", | |
"prettier": "^1.19.1", | |
"prettier-eslint": "^9.0.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist", | |
"module": "CommonJS", | |
"target": "ESNext", | |
"esModuleInterop": true, | |
"allowJs": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment