-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add linter config for schemas #415
base: master
Are you sure you want to change the base?
Conversation
.eslintignore
Outdated
@@ -0,0 +1,8 @@ | |||
data/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point it would be easier to specify only the files that should be linted, not the files that must be ignored:
data/ | |
* | |
!*.js | |
!*.action | |
!*.category | |
!*.domains | |
!*.form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eslint will lint only .js
files, if there is no extensions specified using --ext
. So lint
script will look like this:
eslint --ext .js,.action,.category,.domains,.form . && prettier -c \"**/*\"
package.json
Outdated
@@ -34,8 +34,8 @@ | |||
], | |||
"scripts": { | |||
"test": "npm run lint && metatests test/", | |||
"lint": "eslint . --ignore-path .gitignore && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", | |||
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", | |||
"lint": "eslint \"**/*\" && prettier -c \"*\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lint": "eslint \"**/*\" && prettier -c \"*\"", | |
"lint": "eslint \"**/*\" && prettier -c \"**/*\"", |
package.json
Outdated
"lint": "eslint . --ignore-path .gitignore && prettier -c \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", | ||
"fmt": "prettier --write \"**/*.js\" \"**/*.json\" \"**/*.md\" \".*rc\" \"**/*.yml\"", | ||
"lint": "eslint \"**/*\" && prettier -c \"*\"", | ||
"fmt": "eslint --fix \"**/*\" && prettier --write \"*\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"fmt": "eslint --fix \"**/*\" && prettier --write \"*\"", | |
"fmt": "eslint --fix \"**/*\" && prettier --write \"**/*\"", |
.prettierignore
Outdated
@@ -1,2 +1,7 @@ | |||
data | |||
dist | |||
data/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for the .eslintignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have bumped into a strange behavior of .prettierignore
.
I have tried this, and it lints only gs.js
file and does not go deeper.
*
!*.js
Then I have tried this, and nothing have changed.
*
!**/*.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same with .eslintignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@o-rumiantsev, right, I forgot to add the !*/
rule after the *
.
dd48755
to
51e7b98
Compare
51e7b98
to
081636e
Compare
.prettierignore
Outdated
!*.action | ||
!*.category | ||
!*.domains | ||
!*.form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!*.form | |
!*.form | |
!*.application |
?
schemas/system/Locking.category
Outdated
@@ -1,3 +1,4 @@ | |||
/* eslint-disable no-unused-vars, no-undef, handle-callback-err */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you clarify the need for these?
If they were meant to handle the callback of Lock
action then I'd prefer to just either put () => {}
in there or comment out the arguments if they are needed for some reason.
schemas/system/Permission.category
Outdated
CheckBound: Validate(record => true) | ||
}) | ||
/* eslint-disable no-unused-vars */ | ||
CheckBound: Validate(record => true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
() => true
?
schemas/system/SystemUser.category
Outdated
@@ -1,3 +1,4 @@ | |||
/* eslint-disable no-unused-vars, no-undef */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
Maybe just put SignUp: Action((/* data, callback */) => {
?
@@ -0,0 +1,27 @@ | |||
globals: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look the same as those in schemas/.eslintrc.yml
, could we perhaps put them in a common config file (i.e. schemas-eslint-config.js
) that would be extends
ed in schemas/.eslintrc.yml
and test/fixtures/.eslintrc.yml
?
No description provided.