Skip to content

Commit

Permalink
chore: Improve linting setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JeppeKlitgaard committed Oct 12, 2021
1 parent 8af6382 commit cd0635c
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"env": {
"browser": true,
"es2021": true
"es2021": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"google"
],
"parser": "@typescript-eslint/parser",
Expand All @@ -12,7 +14,8 @@
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
"@typescript-eslint",
"jest"
],
"rules": {
"camelcase": "off",
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
process.env.TZ = 'UTC';
process.env.TZ = 'UTC'; // eslint-disable-line no-undef

// jest.config.ts
import type {Config} from '@jest/types';
Expand Down
256 changes: 256 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"babel-jest": "^27.0.6",
"eslint": "^7.32.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-jest": "^25.0.5",
"jest": "^27.0.6",
"obsidian": "^0.12.0",
"rollup": "^2.32.1",
Expand Down
5 changes: 2 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class LinterPlugin extends Plugin {
callback: () => {
new ConfirmationModal(this.app, this).open();
},
}); ;
});

// Source for save setting
// https://github.com/hipstersmoothie/obsidian-plugin-prettier/blob/main/src/main.ts
Expand All @@ -54,7 +54,6 @@ export default class LinterPlugin extends Plugin {

async onunload() {
console.log('Unloading Linter plugin');

}

async loadSettings() {
Expand Down Expand Up @@ -211,7 +210,7 @@ class SettingTab extends PluginSettingTab {
plugin.saveData(plugin.settings);
});
});
}; ;
};

TextAreaOption.prototype.display = function(containerEl: HTMLElement, settings: LinterSettings, plugin: LinterPlugin): void {
new Setting(containerEl)
Expand Down

0 comments on commit cd0635c

Please sign in to comment.