Skip to content

Commit

Permalink
Add simple-git-hooks, lint-staged;
Browse files Browse the repository at this point in the history
Remove eslint from circleci
Add .prettiertc, .eslintignore, .prettierignore
  • Loading branch information
christinach committed Nov 22, 2023
1 parent ae1cdf4 commit 4ae29f1
Show file tree
Hide file tree
Showing 7 changed files with 475 additions and 26 deletions.
12 changes: 0 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,6 @@ jobs:
- store_test_results:
path: ~/rspec

eslint:
executor: basic-executor
steps:
- attach_workspace:
at: '~/orangelight'
- run:
name: Run eslint
command: yarn run eslint app/javascript/orangelight/availability.es6

js_tests:
executor: basic-executor
steps:
Expand Down Expand Up @@ -178,9 +169,6 @@ workflows:
- erblint:
requires:
- build
- eslint:
requires:
- build
- js_tests:
requires:
- build
Expand Down
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.gitignore
tmp
vendor
public
docs
solr
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"parser": "@babel/eslint-parser",
"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"prettier"
],
"env": {
"browser": true,
"node": true,
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.gitignore
spec
tmp
vendor
public
docs
solr
config
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
semi: false
singleQuote: true
printWidth: 80
trailingComma: 'none'
arrowParens: 'avoid'

18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,33 @@
"babel-jest": "^29.4.0",
"babel-plugin-macros": "^3.1.0",
"eslint": "8.27.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.4.0",
"jquery": "3.5.1",
"lint-staged": "^15.1.0",
"postcss-cssnext": "^3.1.1",
"postcss-import": "^15.1.0",
"prettier": "^3.1.0",
"simple-git-hooks": "^2.9.0",
"vite": "^4.3.0",
"vite-plugin-ruby": "^3.2.0"
},
"simple-git-hooks": {
"pre-commit": "yarn lint-staged"
},
"lint-staged": {
"*.js": [
"prettier --write",
"eslint"
]
},
"scripts": {
"test": "jest",
"test:debug": "node --inspect node_modules/.bin/jest --runInBand",
"eslint": "eslint"
"lint": "eslint --fix --ext .js, app/* --fix",
"format": "prettier . --write",
"prepare": "simple-git-hooks"
},
"jest": {
"verbose": true,
Expand Down
Loading

0 comments on commit 4ae29f1

Please sign in to comment.