Skip to content

Commit

Permalink
fix(CRATemplate): Fix lint command
Browse files Browse the repository at this point in the history
ESLint was broken in the CRA template for two reasons:

- ESLint was unable not import `eslint-config-prettier` (dependency of `@defencedigital/eslint-config-react`) – could be to do with package hoisting not too clear why just this one specifically (is mentioned here though: prettier/eslint-plugin-prettier#396)
- it was trying to lint `src/*` which would be expanded by the shell and fail if the `src/components` directory was empty (except for `.gitkeep`)

This fixes both of those problems.
  • Loading branch information
jpveooys committed Dec 14, 2021
1 parent 5372f12 commit cdda6f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cra-template-defencedigital/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Defence Digital",
"scripts": {
"codegen": "gql-gen --config codegen.yml",
"lint": "eslint src/* --ext .ts --ext .tsx"
"lint": "eslint src --ext .ts --ext .tsx"
},
"dependencies": {
"styled-components": "^5.2.1",
Expand All @@ -20,6 +20,7 @@
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.4",
"@testing-library/user-event": "^10.1.0",
"eslint-plugin-prettier": "^4.0.0",
"formik": "^2.2.9",
"jest-canvas-mock": "^2.3.0",
"typescript": "^3.8.0",
Expand Down

0 comments on commit cdda6f9

Please sign in to comment.