aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.json41
-rw-r--r--.github/workflows/test_and_lint.yml15
-rw-r--r--.gitignore3
-rw-r--r--package.json3
4 files changed, 59 insertions, 3 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..4e55622
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,41 @@
+{
+ "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": {
+ "indent": [
+ "error",
+ 4
+ ],
+ "linebreak-style": [
+ "error",
+ "unix"
+ ],
+ "quotes": [
+ "error",
+ "double"
+ ],
+ "semi": [
+ "error",
+ "always"
+ ]
+ }
+}
diff --git a/.github/workflows/test_and_lint.yml b/.github/workflows/test_and_lint.yml
index e7a0d05..636e181 100644
--- a/.github/workflows/test_and_lint.yml
+++ b/.github/workflows/test_and_lint.yml
@@ -32,5 +32,16 @@ jobs:
- name: Run tests
run: yarn test
-
-
+
+ lint:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - uses: EgorDm/gha-yarn-node-cache@v1
+
+ - name: Install dependencies
+ run: yarn install --dev
+
+ - name: Lint
+ run: yarn run eslint --ext .ts,.tsx --quiet src/
diff --git a/.gitignore b/.gitignore
index 8692cf6..3ac9558 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,6 +8,9 @@
# testing
/coverage
+# linting
+.eslintcache
+
# production
/build
diff --git a/package.json b/package.json
index 059077c..641fe19 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,8 @@
"scripts": {
"start": "cross-env NODE_ENV=development webpack serve",
"build": "cross-env REACT_APP_SHA=$COMMIT_REF REACT_APP_BRANCH=$BRANCH webpack",
- "test": "cross-env jest"
+ "test": "cross-env jest",
+ "lint": "cross-env eslint --cache src/"
},
"eslintConfig": {
"extends": "react-app"