Skip to content

Commit

Permalink
switch to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jul 21, 2024
1 parent d58acc0 commit 466b0f2
Show file tree
Hide file tree
Showing 9 changed files with 2,049 additions and 366 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Install npm modules
run: |
cd public && npm ci && npm run jshint && npm run bundle
cd public && npm ci && npm run eslint && npm run bundle
- name: Set up Go
uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- name: Install npm modules
run: |
cd public && npm ci && npm run jshint && npm run bundle
cd public && npm ci && npm run eslint && npm run bundle
- name: Install Go
uses: actions/setup-go@v5
Expand Down
35 changes: 35 additions & 0 deletions public/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import stylisticJs from '@stylistic/eslint-plugin-js'

export default [
{
ignores: ["js/bundle.js"]
},
{
files: ["**/*.js"]
},
{
languageOptions: {
globals: {
Vue: "readonly",
VueRouter: "readonly",
CodeMirror: "readonly",
Chart: "readonly",
VueDatePicker: "readonly",
...globals.browser
}
}
},
{
plugins: {
'@stylistic/js': stylisticJs
},
rules: {
'@stylistic/js/semi': "error",
}
},
pluginJs.configs.recommended,
...pluginVue.configs["flat/essential"],
];
1 change: 0 additions & 1 deletion public/js/.jshintignore

This file was deleted.

14 changes: 0 additions & 14 deletions public/js/.jshintrc

This file was deleted.

4 changes: 2 additions & 2 deletions public/js/service/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { get_features, set_feature as set } from "../api/features.js";
export const store = Vue.reactive({});

export async function check_features() {
const f = await get_features()
const f = await get_features();
Object.assign(store, f);
}

export async function set_feature(name, enabled) {
await set({ name: name, enabled: enabled })
await set({ name: name, enabled: enabled });
await check_features();
};

Expand Down
6 changes: 3 additions & 3 deletions public/js/service/mods.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ export async function add(m) {

export async function add_mtui() {
store.busy = true;
await create_mtui_mod()
await create_mtui_mod();
await update();
}

export async function add_beerchat() {
store.busy = true;
await create_beerchat_mod()
await create_beerchat_mod();
await update();
}

export async function add_mapserver() {
store.busy = true;
await create_mapserver_mod()
await create_mapserver_mod();
await update();
}

Expand Down
Loading

0 comments on commit 466b0f2

Please sign in to comment.