Add CI to check code format

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
This commit is contained in:
Sebastian Martinez
2021-06-14 09:59:09 +02:00
committed by Alexis Sellier
parent aaabb99074
commit 2b5efedfbd
4 changed files with 51 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+32
View File
@@ -0,0 +1,32 @@
module.exports = {
env: {
browser: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
sourceType: "module",
},
plugins: [
"svelte3",
"@typescript-eslint"
],
overrides: [
{
files: ["*.svelte"],
processor: "svelte3/svelte3",
}
],
rules: {
"@typescript-eslint/no-explicit-any": "off",
indent: ["error", 2, { "SwitchCase": 1 }]
},
settings: {
"svelte3/typescript": true,
},
};
+12
View File
@@ -0,0 +1,12 @@
name: check-format
on: [push]
jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: ./scripts/check-format
shell: bash
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
# Checks local /node_modules,
# if not found will download that package and execute it.
# Does not modify files, informs bad code format
npx eslint .