Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Install React #346

Merged
merged 3 commits into from
Aug 22, 2019
Merged

Install React #346

merged 3 commits into from
Aug 22, 2019

Conversation

bbecquet
Copy link
Contributor

Description

Install the minimal React setup for our toolset.
As React is not imported yet in any code, this doesn't change what's built.

Why

Prepare things to start migrating stuff.

"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"plugin:react/recommended"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to make ESLint understand React specifics. We can configure it further later (see doc).

@@ -85,7 +93,8 @@
"no-var": "error",
"eqeqeq": "error",
"object-curly-spacing": ["error", "always"],
"object-shorthand": "error"
"object-shorthand": "error",
"react/prop-types": 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just disable warning for props used without prop-types declaration, because we don't use it yet. https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md

@@ -3,6 +3,7 @@
module.exports = function(mode) {
const plugins = [
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-class-properties',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly related to React, but this allows to use simplified ES class syntax, which is handy for state, static properties and autobound methods. See this article for examples.

@bbecquet bbecquet mentioned this pull request Aug 21, 2019
@bbecquet bbecquet merged commit 42320c0 into Qwant:master Aug 22, 2019
@bbecquet bbecquet deleted the install-react branch August 22, 2019 13:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants