add eslint & .env file

This commit is contained in:
Chika 2021-04-15 12:35:22 +03:00
parent cca03a0f4a
commit 48719e5029
5 changed files with 36 additions and 12 deletions

2
.env.production Normal file
View File

@ -0,0 +1,2 @@
REACT_APP_PRODUCTION=true
GENERATE_SOURCEMAP=false

25
.eslintrc.json Normal file
View File

@ -0,0 +1,25 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"no-console": "warn",
"react/display-name": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
}
}

5
.gitignore vendored
View File

@ -14,10 +14,7 @@
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.development
npm-debug.log*
yarn-debug.log*

View File

@ -1,9 +1,5 @@
FROM node:14-alpine as builder
ENV NODE_ENV=production
ENV REACT_APP_CRM=prod
ENV GENERATE_SOURCEMAP=false
WORKDIR /app
COPY package.json /app/

View File

@ -41,14 +41,18 @@
"@types/react-router-dom": "^5.1.7",
"@types/styled-components": "^5.1.9",
"@types/styled-system": "^5.1.11",
"cross-env": "^7.0.3",
"dotenv": "^8.2.0"
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.24.0",
"eslint-plugin-react": "^7.23.2"
},
"scripts": {
"test": "craco test",
"eject": "react-scripts eject",
"start": "cross-env NODE_ENV=development REACT_APP_CRM=dev craco start",
"build": "craco build"
"start": "craco start",
"build": "craco build",
"eslint": "eslint ./src",
"eslint:fix": "eslint ./src --fix"
},
"eslintConfig": {
"extends": "react-app"