From 48719e50298b975b7c029becb378c042d856cb02 Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 15 Apr 2021 12:35:22 +0300 Subject: [PATCH] add eslint & .env file --- .env.production | 2 ++ .eslintrc.json | 25 +++++++++++++++++++++++++ .gitignore | 5 +---- Dockerfile | 4 ---- package.json | 12 ++++++++---- 5 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 .env.production create mode 100644 .eslintrc.json diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..92b24a4 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +REACT_APP_PRODUCTION=true +GENERATE_SOURCEMAP=false \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..63e9daf --- /dev/null +++ b/.eslintrc.json @@ -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" + } +} diff --git a/.gitignore b/.gitignore index 6a0ccd4..ac5f6a7 100644 --- a/.gitignore +++ b/.gitignore @@ -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* diff --git a/Dockerfile b/Dockerfile index 9f72b8b..98331e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ diff --git a/package.json b/package.json index d2955d6..2368b20 100644 --- a/package.json +++ b/package.json @@ -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"