alexey-koran / react-template Goto Github PK
View Code? Open in Web Editor NEWUp-to date react + typescript template
License: MIT License
Up-to date react + typescript template
License: MIT License
Sections:
https://github.com/alexey-koren/bundlers-boilerplates/blob/95332b2ec6ea9f09c85c7563c7c35865cef63ff5/webpack.config.ts#L108
It seems you should fix "static" to "src/static"
ESLInt warns about reassigning state in createSlice()
const langSlice = createSlice({
name: 'language',
initialState,
reducers: {
setLanguage (state, action) {
state.currentLang = action.payload; // Error!
},
},
});
Suggestion: add rule as mentioned in RTK docs
https://redux-toolkit.js.org/usage/immer-reducers#linting-state-mutations
{
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }]
}
Should add new plugin
npm install --save-dev @babel/plugin-transform-runtime
npm install --save @babel/runtime
.babelrc
{
...
"plugins": [
...
["@babel/plugin-transform-runtime"]
],
"sourceType": "unambiguous"
}
https://babeljs.io/docs/en/babel-plugin-transform-runtime#regenerator
[You'll want to set the sourceType option to either "unambiguous" or "script" if your files aren't ES modules. The docs for the option explain, but essentially because the type is wrong, it will insert import statements into your CommonJS file, causing the error you're seeing.](babel/babel#8900.)
https://github.com/alexey-koren/bundlers-boilerplates/blob/95332b2ec6ea9f09c85c7563c7c35865cef63ff5/.eslintrc#L186
Maybe this is better "react/jsx-fragments" : ["error", "syntax"]
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md
Sections:
Installation
Quick start
Packages & their settings, purpose
Strongly recommended VSCode plugins
Examples
Add usage examples:
Please check: https://github.com/alexey-koran/react-template/blob/main/webpack.config.ts#L120
.prettierrc
was renamed to prettier.config.cjs
in 08e74bf
https://github.com/alexey-koren/bundlers-boilerplates/blob/95332b2ec6ea9f09c85c7563c7c35865cef63ff5/webpack.config.ts#L43
devtool: isProduction ? 'source-map' : 'eval-source-map'
helps to avoid chrome console warnings
https://stackoverflow.com/questions/61767538/devtools-failed-to-load-sourcemap-for-webpack-node-modules-js-map-http-e
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.