Skip to content

Commit 8af4edf

Browse files
committed
Fix #9 lint, fix #7 negative cases, fix #8 fetch reference error
1 parent c5c61eb commit 8af4edf

File tree

11 files changed

+2684
-132
lines changed

11 files changed

+2684
-132
lines changed

.github/CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ Please create an [issue](https://github.com/boly38/dropbox-refresh-token/issues)
99
If you want to push some code :
1010
- following next `HowTo push some code` guide,
1111
- create a [pull request](https://github.com/boly38/dropbox-refresh-token/pulls) that link your issue using `#<issue_id>`.
12+
- execute linter (you could suggest test)
13+
14+
## linter
15+
* launch lint using `npm run lint`.
16+
17+
About linter :
18+
- locally ESLint 9.0 is used as dev dependencies and rely on `eslint.config.js` ([doc](https://eslint.org/docs/latest/use/configure/configuration-files))
19+
- on Github PR, [HoundCi service](https://houndci.com) is triggered and rely on [`.hound.yml`](../.hound.yml) file and derived file. HoundCi is yet not compatible with 9.0 config file ([src](http://help.houndci.com/en/articles/2461415-supported-linters) - [eslint 8.0 config file doc](https://eslint.org/docs/v8.x/use/configure/configuration-files).
20+
1221

1322

1423
# Maintainers HowTos

.hound.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
jshint:
2+
config_file: .jshintrc
3+
# ESLint supported version
4+
# http://help.houndci.com/en/articles/2461415-supported-linters
5+
eslint:
6+
enabled: true
7+
version: 8.1.0
8+
config_file: .hound_eslint_config.json

.hound_eslint_config.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"root": true,
3+
"extends": [
4+
"eslint:recommended"
5+
],
6+
"env" : {
7+
"browser" : true,
8+
"node" : true,
9+
"es6" : true
10+
},
11+
"parserOptions": {
12+
"sourceType": "module",
13+
"ecmaVersion": 2022
14+
},
15+
"plugins": [
16+
],
17+
"rules": {
18+
}
19+
}

eslint.config.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// https://eslint.org/docs/latest
2+
import js from "@eslint/js";
3+
import globals from "globals";
4+
import mochaPlugin from 'eslint-plugin-mocha'; // https://www.npmjs.com/package/eslint-plugin-mocha
5+
import stylisticJs from '@stylistic/eslint-plugin-js'
6+
export default [
7+
js.configs.recommended, // Recommended config applied to all files
8+
mochaPlugin.configs.flat.recommended, // or `mochaPlugin.configs.flat.all` to enable all
9+
{
10+
"files": ["src/**/*.js"],
11+
"languageOptions": {
12+
ecmaVersion: 2022,
13+
sourceType: "module",
14+
globals: {
15+
...globals.node,
16+
"console": true,
17+
"process": true,
18+
"btoa": true
19+
},
20+
"parserOptions": {
21+
"sourceType": "module",
22+
"allowImportExportEverywhere": true
23+
},
24+
},
25+
plugins: {
26+
'@stylistic/js': stylisticJs
27+
},
28+
"rules": {
29+
"mocha/no-mocha-arrows": "off", /* pff */
30+
'@stylistic/js/no-extra-semi': "error", /* to match houndci : https://eslint.org/docs/latest/rules/no-extra-semi */
31+
}
32+
}
33+
];

0 commit comments

Comments
 (0)