Skip to content

Commit 7aa78de

Browse files
Update linting and prettier (#2663)
* Update linting and prettier * Tweak gitignore
1 parent e711e04 commit 7aa78de

26 files changed

+451
-274
lines changed

.eslintrc.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
module.exports = {
22
root: true,
33
parserOptions: {
4-
ecmaVersion: 2020,
4+
ecmaVersion: 'latest',
55
sourceType: 'module'
66
},
7-
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
7+
extends: ['eslint:recommended'],
88
env: {
9-
browser: true,
10-
es6: true,
11-
node: true
9+
browser: true
1210
},
13-
plugins: ['svelte3'],
11+
plugins: [
12+
'svelte3'
13+
],
1414
rules: {
1515
'max-lines': [
1616
'warn',
17-
{ max: 250, skipBlankLines: true, skipComments: true }
17+
{ max: 500, skipBlankLines: true, skipComments: true }
1818
],
1919
'no-console': 'off',
2020
'prefer-const': 'off'
@@ -25,6 +25,20 @@ module.exports = {
2525
files: ['**/*.svelte'],
2626
processor: 'svelte3/svelte3'
2727
},
28+
// Typescript files
29+
{
30+
parser: '@typescript-eslint/parser',
31+
files: ['**/*.ts'],
32+
plugins: ['@typescript-eslint'],
33+
extends: ['plugin:@typescript-eslint/recommended'],
34+
rules: {
35+
'@typescript-eslint/no-unused-vars': [
36+
'error',
37+
{ argsIgnorePattern: '^_' }
38+
],
39+
'prefer-rest-params': 'off'
40+
}
41+
},
2842
// node files
2943
{
3044
files: [
@@ -38,7 +52,7 @@ module.exports = {
3852
],
3953
parserOptions: {
4054
sourceType: 'module',
41-
ecmaVersion: 2015
55+
ecmaVersion: 2020
4256
},
4357
env: {
4458
node: true

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Lint & Test
33
on:
44
push:
55
branches:
6+
- main
67
- master
78
pull_request: {}
89

@@ -22,7 +23,7 @@ jobs:
2223
run: pnpm install
2324

2425
- name: Run linting
25-
run: pnpm lint:js
26+
run: pnpm lint
2627

2728
typecheck:
2829
name: Type Check

.gitignore

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
/.idea/
33
/.vscode/
44

5+
.eslintcache
6+
.nyc_output/
7+
coverage/
8+
dist/
9+
node_modules/
10+
511
/.log/
6-
/.nyc_output/
7-
/coverage/
12+
813
/cypress/
914
/docs/
10-
/dist/
1115
/site/
12-
/node_modules/
1316
/test/unit/dist
14-
/.DS_Store
17+
*.DS_Store
1518
/.sass-cache
1619
/npm-debug.log*
1720
/stats.html

.prettierrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
module.exports = {
44
arrowParens: 'always',
55
trailingComma: 'none',
6-
singleQuote: true
6+
singleQuote: true,
7+
plugins: ['prettier-plugin-svelte'],
8+
overrides: [{ files: '*.svelte', options: { parser: 'svelte' } }]
79
};

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"dev": "pnpm watch",
1818
"docs": "node_modules/.bin/jsdoc -c .jsdoc.js --verbose",
1919
"build:landing": "pnpm -F landing build",
20+
"lint": "pnpm -F '*' lint",
21+
"lint:fix": "pnpm -F '*' lint:fix",
2022
"lint:js": "pnpm -F '*' lint:js",
2123
"start": "pnpm watch",
2224
"test:ci": "pnpm build && pnpm test:unit:ci && pnpm test:cy:ci:chrome",
@@ -33,28 +35,28 @@
3335
"@babel/preset-env": "^7.24.3",
3436
"@release-it-plugins/lerna-changelog": "^6.1.0",
3537
"@release-it-plugins/workspaces": "^4.2.0",
38+
"@typescript-eslint/eslint-plugin": "^7.4.0",
39+
"@typescript-eslint/parser": "^7.4.0",
3640
"autoprefixer": "^10.4.19",
3741
"better-docs": "^2.7.3",
42+
"concurrently": "^8.2.2",
3843
"cypress": "^13.7.1",
3944
"cypress-plugin-tab": "^1.0.5",
4045
"del": "^7.1.0",
4146
"eslint": "^8.56.0",
42-
"eslint-config-prettier": "^9.1.0",
4347
"eslint-plugin-jest": "^27.6.3",
44-
"eslint-plugin-prettier": "^5.1.3",
4548
"eslint-plugin-svelte3": "^4.0.0",
4649
"glob": "^10.3.10",
4750
"jsdoc": "^4.0.2",
4851
"jsdoc-template-ship-shape": "^0.1.1",
4952
"postcss": "^8.4.38",
5053
"postinstall-postinstall": "^2.1.0",
5154
"prettier": "^3.1.1",
55+
"prettier-plugin-svelte": "^3.2.2",
5256
"release-it": "^17.1.1",
5357
"release-plan": "^0.9.0",
5458
"replace": "^1.2.2",
5559
"shepherd.js": "workspace:*",
56-
"svelte": "^3.59.2",
57-
"svelte-preprocess": "^5.1.3",
5860
"typescript": "^5.4.2"
5961
},
6062
"packageManager": "pnpm@8.15.4",

0 commit comments

Comments
 (0)