Skip to content

Commit 1fee202

Browse files
authored
Use prettifier (#40)
* Change single quote to double quote * Build linux only for testing
1 parent 128d3dd commit 1fee202

21 files changed

+479
-380
lines changed

.eslintrc

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
{
22
"extends": "./.config/.eslintrc",
3-
"rules": {
4-
"quotes": [
5-
"error",
6-
"double",
7-
{
8-
"avoidEscape": true
9-
}
10-
],
11-
"semi": [
12-
"error",
13-
"always"
14-
]
15-
}
16-
}
3+
}

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- "*"
6+
- '*'
77
paths-ignore:
88
- README.md
99
pull_request:
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set up Python ${{ matrix.python-version }}
3939
uses: actions/setup-python@v5
4040
with:
41-
python-version: "3.11"
41+
python-version: '3.11'
4242
- name: Update plugin.json
4343
run: python3 scripts/update_plugin_metadata.py
4444
env:
@@ -49,8 +49,8 @@ jobs:
4949
- name: Setup Node.js environment
5050
uses: actions/setup-node@v4
5151
with:
52-
node-version: "20"
53-
cache: "npm"
52+
node-version: '20'
53+
cache: 'npm'
5454

5555
- name: Install dependencies
5656
run: npm ci
@@ -76,7 +76,7 @@ jobs:
7676
if: steps.check-for-backend.outputs.has-backend == 'true'
7777
uses: actions/setup-go@v5
7878
with:
79-
go-version: "1.21"
79+
go-version: '1.21'
8080

8181
- name: Test backend
8282
if: steps.check-for-backend.outputs.has-backend == 'true'
@@ -90,7 +90,7 @@ jobs:
9090
uses: magefile/mage-action@v3
9191
with:
9292
version: latest
93-
args: buildAll
93+
args: build:linux
9494

9595
- name: Check for E2E
9696
id: check-for-e2e
@@ -172,8 +172,8 @@ jobs:
172172
- name: Setup Node.js environment
173173
uses: actions/setup-node@v4
174174
with:
175-
node-version: "20"
176-
cache: "npm"
175+
node-version: '20'
176+
cache: 'npm'
177177

178178
- name: Install dev dependencies
179179
run: npm ci
@@ -186,7 +186,7 @@ jobs:
186186
- name: Wait for Grafana to start
187187
uses: nev7n/wait_for_response@v1
188188
with:
189-
url: "http://localhost:3000/"
189+
url: 'http://localhost:3000/'
190190
responseCode: 200
191191
timeout: 60000
192192
interval: 500

.prettierrc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
module.exports = {
2-
// Prettier configuration provided by Grafana scaffolding
1+
/**
2+
* @type {import('prettier').Options}
3+
*/
4+
const config = {
35
...require('./.config/.prettierrc.js'),
6+
singleQuote: true,
7+
trailingComma: 'all',
48
};
9+
10+
module.exports = config;

.vscode/settings.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"typescript.format.semicolons": "insert",
3-
"typescript.preferences.quoteStyle": "double",
4-
"editor.formatOnSave": true,
5-
"editor.trimAutoWhitespace": true,
6-
"go.testFlags": [
7-
"-v"
8-
]
9-
}
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"go.testFlags": ["-v"]
5+
}

docker-compose.test.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS: haohanyang-mongodb-datasource
3030
networks:
3131
- mongodb-datasource
32-
32+
3333
mongo-no-auth:
3434
image: mongo
3535
container_name: mongodb-datasource-mongo-no-auth
@@ -52,5 +52,3 @@ services:
5252
networks:
5353
mongodb-datasource:
5454
driver: bridge
55-
56-

docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Docker Compose file for dev
2+
13
services:
24
grafana:
35
user: root

jest-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Jest setup provided by Grafana scaffolding
2-
import "./.config/jest-setup";
2+
import './.config/jest-setup';

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// force timezone to UTC to allow tests to work regardless of local timezone
22
// generally used by snapshots, but can affect specific tests
3-
process.env.TZ = "UTC";
3+
process.env.TZ = 'UTC';
44

55
module.exports = {
66
// Jest configuration provided by Grafana scaffolding
7-
...require("./.config/jest.config"),
7+
...require('./.config/jest.config'),
88
};

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"jest": "^29.5.0",
4343
"jest-environment-jsdom": "^29.5.0",
4444
"mongodb": "^6.9.0",
45-
"prettier": "^2.8.7",
45+
"prettier": "^3.4.0",
4646
"replace-in-file-webpack-plugin": "^1.0.6",
4747
"sass": "1.63.2",
4848
"sass-loader": "13.3.1",

0 commit comments

Comments
 (0)