Skip to content

Commit

Permalink
76 Add formatter for JavaScript/TypeScript files (#79)
Browse files Browse the repository at this point in the history
* add lint config

* removed uitests from ts include

* run eslint commands

* strict null checks false

* removed edits to tsconfig
  • Loading branch information
bryannho committed Sep 26, 2023
1 parent f477bc6 commit 567fb10
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
"extends": "standard-with-typescript",
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}",
""
],
"parserOptions": {
"sourceType": "script",
"project": "./tsconfig.json",
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
},
"rules": {
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ pip install -r requirements.dev.txt

jlpm install
```
Note: `pkgmt format` can be used to format and lint before committing code.
Note: `pkgmt format` can be used to format and lint Python files before committing code.
To format JavaScript and TypeScript files, use `yarn run eslint`. To lint without formatting,
use `yarn run eslint:check`

```bash
# Note: this command will take some time the first time as it has to install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"clean:labextension": "rimraf jupysql_plugin/labextension jupysql_plugin/_version.py",
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
"eslint": "jlpm eslint:check --fix",
"eslint:check": "eslint . --cache --ext .ts,.tsx",
"eslint:check": "eslint src/ --cache --ext .ts,.tsx",
"install:extension": "jlpm build",
"lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
"lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
Expand Down

0 comments on commit 567fb10

Please sign in to comment.