Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tabs
insert_final_newline = true
trim_trailing_whitespace = true
44 changes: 44 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "airbnb",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx"
]
}
]
}
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
yarn.lock*

# Runtime data
pids
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Installing all the dependencies of project
- In the terminal run: `npm install` or `yarn install` or `yarn`

## Setting up ESLint

Just run:
- `npm install --save-dev eslint eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-import`
- In the terminal run: `eslint --init` [video](https://www.youtube.com/watch?v=cMrDePs86Uo&t=479s)
- In the file `.eslintrc.js` change the extends to `'extends': 'airbnb'`
- You can create an npm script by adding something like this to your `package.json` file:
```
{
"scripts": {
"lint": "eslint app.js"
}
}
```
- Then you can run ESLint by using `npm run lint` in the terminal.
- Other alternative could be execute ESLint Task, open the command palette from VS Code and execute below command: `Ctrl + Shift + p` and select `Task: Run tash, npm: lint`
- [documentation](http://shripalsoni.com/blog/configure-eslint-in-visual-studio-code/)

## Setting up EditorConfig

- [documentation](https://codeburst.io/setting-up-eslint-and-editorconfig-in-react-native-projects-31b4d9ddd0f6)

## Running the project

With npm:
- `npm start`
- `npm lint`

With yarn:
- `yarn start`

## Usage yarn

Adding a dependency:
- `yarn add [package]`

Upgrading a dependency:
- `yarn upgrade [package]`

Removing a dependency:
- `yarn remove [package]`

[documentation](https://yarnpkg.com/en/docs/usage)
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --mode development --open --hot",
"build": "webpack --mode production"
"build": "webpack --mode production",
"lint": "eslint ."
},
"repository": {
"type": "git",
Expand All @@ -29,6 +30,11 @@
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.5",
"babel-preset-env": "^1.7.0",
"eslint": "^5.14.1",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3",
Expand Down