Skip to content

Commit

Permalink
Added linting (eslint and stylelint)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopperelec committed Nov 10, 2023
1 parent 845e6b4 commit 3ceecaf
Show file tree
Hide file tree
Showing 14 changed files with 3,359 additions and 343 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules/
/build/
/.svelte-kit/
/vite.config.ts.timestamp-*.mjs
51 changes: 51 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = {
extends: [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/prettier",
],

parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ["*.svelte"],
plugins: ["svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: {
ts: "@typescript-eslint/parser",
js: "espree",
},
},
},
{
files: ["*.js"],
parser: "espree",
}
],

env: {
browser: true,
node: true,
es2020: true,
},

settings: {
svelte: {
kit: {
paths: {
base: process.env.BASE_PATH,
},
},
},
},

globals: {
NodeJS: true
},
};
21 changes: 21 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Linting

on:
push:
branches: "master"
pull_request:

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- run: npm ci
- name: eslint
run: npm run eslint
- name: stylelint
run: npm run stylelint
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/node_modules/
/build/
/.svelte-kit/
/package/
/vite.config.ts.timestamp-*.mjs
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/node_modules/
/build/
/.svelte-kit/
/package/
/vite.config.ts.timestamp-*.mjs
3 changes: 3 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules/
/build/
/.svelte-kit/
14 changes: 14 additions & 0 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
extends:
- stylelint-config-standard-scss
- stylelint-config-prettier-scss
- stylelint-config-html/html
- stylelint-config-html/svelte
plugins:
stylelint-use-nesting
rules:
custom-property-empty-line-before: never
selector-pseudo-class-no-unknown:
- true
- ignorePseudoClasses:
- global
csstools/use-nesting: always
Loading

0 comments on commit 3ceecaf

Please sign in to comment.