Skip to content

Commit dc12a7a

Browse files
authored
Merge pull request #126 from IQSS/58-automatically-reformat-code
58 - Automatically reformat code
2 parents ac647e9 + c5d0a10 commit dc12a7a

File tree

166 files changed

+7377
-5221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+7377
-5221
lines changed

.eslintrc

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
11
{
2-
"root": true,
32
"parser": "@typescript-eslint/parser",
4-
"plugins": ["@typescript-eslint", "jest"],
3+
"plugins": ["@typescript-eslint", "simple-import-sort", "import", "unused-imports", "jest"],
54
"extends": [
65
"eslint:recommended",
76
"plugin:@typescript-eslint/recommended",
7+
"plugin:@typescript-eslint/recommended",
8+
"plugin:prettier/recommended",
89
"plugin:jest/recommended"
9-
]
10+
],
11+
"settings": {
12+
"import/resolver": {
13+
"node": {
14+
"extensions": [".js", ".ts"]
15+
}
16+
}
17+
},
18+
"env": {
19+
"browser": true,
20+
"es2021": true,
21+
"jest": true,
22+
"node": true
23+
},
24+
"parserOptions": {
25+
"ecmaVersion": 2021,
26+
"sourceType": "module",
27+
"project": [
28+
"./tsconfig.json"
29+
]
30+
},
31+
"rules": {
32+
"@typescript-eslint/no-unused-vars": "off",
33+
"unused-imports/no-unused-imports": "error",
34+
"unused-imports/no-unused-vars": [
35+
"warn",
36+
{
37+
"vars": "all",
38+
"varsIgnorePattern": "^_",
39+
"args": "after-used",
40+
"argsIgnorePattern": "^_"
41+
}
42+
],
43+
"@typescript-eslint/no-empty-function": [
44+
"error",
45+
{
46+
"allow": ["arrowFunctions"]
47+
}
48+
],
49+
"prettier/prettier": [
50+
"error",
51+
{
52+
"semi": false,
53+
"tabWidth": 2,
54+
"printWidth": 100,
55+
"singleQuote": true,
56+
"trailingComma": "none",
57+
"bracketSameLine": true
58+
}
59+
]
60+
}
1061
}

.github/workflows/deploy_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838

3939
- name: Build package
4040
run: npm run build
41-
41+
4242
- name: Update package version
43-
run: |
43+
run: |
4444
SHORT_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
4545
CURRENT_PACKAGE_VERSION=$(cat package.json | jq -r '.version')
4646
npm version "${CURRENT_PACKAGE_VERSION}-pr${{ github.event.number }}.${SHORT_SHA}" --no-git-tag-version

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: lint
2+
3+
on: push
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-node@v3
11+
with:
12+
node-version: 19
13+
14+
- name: Install npm dependencies
15+
run: npm ci
16+
17+
- name: Type check
18+
run: npm run typecheck
19+
20+
- name: ESLint
21+
run: npm run lint:eslint
22+
23+
- name: Prettier
24+
run: npm run lint:prettier

.prettierrc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"printWidth": 120,
3-
"trailingComma": "all",
4-
"singleQuote": true
5-
}
2+
"semi": false,
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"singleQuote": true,
6+
"trailingComma": "none",
7+
"bracketSameLine": true
8+
}

docs/installation.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ An unstable 2.x version of this package with breaking changes is under developme
1818

1919
Until a 2.0 version is officially released, it can be installed from https://github.com/IQSS/dataverse-client-javascript/pkgs/npm/dataverse-client-javascript
2020

21-
2221
### Create a `.npmrc` file and add a token
2322

2423
To install the [@iqss/dataverse-client-javascript](https://github.com/IQSS/dataverse-client-javascript/pkgs/npm/dataverse-client-javascript)
@@ -89,20 +88,24 @@ function App() {
8988
}
9089

9190
export default App
92-
````
91+
```
9392

9493
The same example but with example values set:
9594

9695
```typescript
97-
ApiConfig.init('http://localhost:8000/api/v1', DataverseApiAuthMechanism.API_KEY, 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
96+
ApiConfig.init(
97+
'http://localhost:8000/api/v1',
98+
DataverseApiAuthMechanism.API_KEY,
99+
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
100+
)
98101

99102
function App() {
100103
/* Yor App code */
101104
}
102105

103106
export default App
104-
````
107+
```
105108

106-
We can initialize the `ApiConfig` object as an unauthenticated user, by setting `undefined` as the API Key value.
109+
We can initialize the `ApiConfig` object as an unauthenticated user, by setting `undefined` as the API Key value.
107110

108111
This will allow use cases that do not require authentication to be successfully executed, but those that do require authentication will fail.

docs/localDevelopment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ Fix linting checks on the code:
9292

9393
```bash
9494
npm run lint:fix
95-
```
95+
```

0 commit comments

Comments
 (0)