Skip to content
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

Chore: Fix eslint usage #293

Merged
merged 3 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": ["@grafana/eslint-config"]
}
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('.prettierrc.json'),
};
82 changes: 0 additions & 82 deletions eslint.json

This file was deleted.

12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "http://github.com/grafana/grafana-image-renderer.git"
},
"scripts": {
"eslint": "eslint -c eslint.json",
"eslint": "eslint . --ext .ts",
"typecheck": "tsc --noEmit",
"prettier:check": "prettier --list-different \"**/*.ts\"",
"prettier:write": "prettier --list-different \"**/*.ts\" --write",
Expand All @@ -22,7 +22,6 @@
"@grpc/proto-loader": "^0.5.4",
"@hapi/boom": "^9.1.0",
"chokidar": "^3.5.2",
"eslint": "^7.13.0",
"express": "^4.16.3",
"express-prom-bundle": "^5.1.5",
"google-protobuf": "3.5.0",
Expand All @@ -37,8 +36,17 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@grafana/eslint-config": "^2.5.0",
"@types/express": "^4.11.1",
"@types/node": "^14.14.41",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
Comment on lines +48 to +49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we need these since we're not using react here, the same goes for jsdoc plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we don't really need them, but they are required when using this "extends": ["@grafana/eslint-config"].

I honestly wondered if it was worth it or if we should use our own config and preferred to use the Grafana config and keep these extra dependencies. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, I guess we can keep these extra dependencies, they're dev dependencies anyways, so we don't need to maintain a separate config for the image renderer.

"husky": "^4.3.8",
"lint-staged": "^9.5.0",
"pkg": "^5.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export class ConsoleLogger implements Logger {
});

this.errorWriter = {
write: message => {
write: (message) => {
this.logger.error(message);
},
};
this.debugWriter = {
write: message => {
write: (message) => {
this.logger.debug(message);
},
};
Expand Down
Loading