Skip to content

Commit

Permalink
chore: add linting on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jillro committed Dec 13, 2024
1 parent d2fa7e6 commit db49c1c
Show file tree
Hide file tree
Showing 7 changed files with 739 additions and 443 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on: push

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"

- name: Install dependencies
run: npm install

- name: Lint plugin
run: npm run lint
File renamed without changes.
43 changes: 43 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import globals from "globals";
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import svelte from "eslint-plugin-svelte";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import svelteParser from "svelte-eslint-parser";
import tsParser from "@typescript-eslint/parser";

export default [
js.configs.recommended,
tseslint.configs.eslintRecommended,
...tseslint.configs.recommended,
...svelte.configs["flat/prettier"],
{
files: ["**/*.ts", "**/*.svelte", "**/*.mjs", "**/*.js"],
languageOptions: {
parser: tsParser,
globals: { ...globals.node },
sourceType: "module",
},
plugins: { "@typescript-eslint": tsPlugin },
rules: {
"no-undef": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { args: "none" }],
"@typescript-eslint/ban-ts-comment": "off",
"no-prototype-builtins": "off",
"@typescript-eslint/no-empty-function": "off",
},
},
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: "@typescript-eslint/parser",
},
},
},
{
ignores: ["node_modules", "main.js"],
},
];
Loading

0 comments on commit db49c1c

Please sign in to comment.