Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit 239a30a

Browse files
committed
chore: updated linting
1 parent 56d5bf4 commit 239a30a

13 files changed

+83
-71
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
*.config.js
21
__sapper__
2+
*.config.js
33
static
4-
src/*.js
4+
dist
5+
packages/docs/src/*.js

.eslintrc.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,31 @@ module.exports = {
2323
},
2424
},
2525
{
26-
files: ['tests/**/*.js'],
26+
files: ['**/tests/**/*.js'],
2727
env: { jest: true },
2828
rules: {
2929
'import/no-unresolved': ['error', { ignore: ['^@s/'] }],
3030
},
3131
},
32+
{
33+
files: ['packages/docs/**/*.{js,svelte}'],
34+
rules: {
35+
'import/no-extraneous-dependencies': 'off',
36+
'import/prefer-default-export': 'off',
37+
'no-return-assign': ['error', 'except-parens'],
38+
'no-param-reassign': ['error', { props: false }],
39+
},
40+
globals: {
41+
ClipboardJS: 'readonly',
42+
},
43+
},
3244
],
3345
extends: ['eslint:recommended', 'airbnb-base'],
3446
settings: {
3547
'svelte3/ignore-styles': () => true,
3648
},
3749
rules: {
38-
camelcase: ['error', { allow: ['[_][a-z]{1,5}$'] }],
50+
camelcase: 'off',
3951
'no-nested-ternary': 'off',
4052
'import/no-extraneous-dependencies': 'off',
4153
'global-require': 'off',

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__sapper__
2+
dist
3+
packages/api-generator/src/*.json
4+
packages/docs/src/*.js
5+
static

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"svelteSortOrder" : "scripts-styles-markup",
3+
"svelteStrictMode": false,
4+
"svelteBracketNewLine": false,
5+
"svelteAllowShorthand": true,
6+
"svelteIndentScriptAndStyle": true,
7+
"singleQuote": true,
8+
"semi": true
9+
}

.stylelintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_reset.scss
2+
_material-theme.scss

packages/svelte-materialify/.stylelintrc renamed to .stylelintrc

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"extends": "stylelint-config-standard",
3-
"ignoreFiles": [
4-
"./src/styles/generic/_reset.scss"
5-
],
63
"plugins": [
74
"stylelint-scss"
85
],

package.json

+39-5
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,56 @@
1212
"scripts": {
1313
"docs": "yarn workspace docs export",
1414
"dev": "yarn workspace docs dev",
15-
"lint": "yarn workspaces run lint",
16-
"lint:fix": "yarn workspaces run lint:fix",
1715
"release": "yarn workspace svelte-materialify release",
1816
"start": "yarn workspaces run start",
1917
"api": "yarn workspace svelte-materialify-api start",
20-
"precommit": "yarn workspaces run precommit"
18+
"test": "yarn workspace svelte-materialify test",
19+
"lint": "concurrently \"npm:lint:js\" \"npm:lint:css\"",
20+
"lint:fix": "concurrently \"npm:lint:js:fix\" \"npm:lint:css:fix\"",
21+
"lint:js": "eslint . --ext .svelte,.js",
22+
"lint:js:fix": "eslint . --ext .svelte,.js --fix",
23+
"lint:css": "stylelint **/*.scss --syntax scss",
24+
"lint:css:fix": "stylelint **/*.scss --syntax scss --fix",
25+
"fmt": "prettier . -c --plugin-search-dir=.",
26+
"fmt:fix": "prettier . -w --plugin-search-dir=."
2127
},
2228
"husky": {
2329
"hooks": {
24-
"pre-commit": "yarn precommit"
30+
"pre-commit": "lint-staged"
2531
}
2632
},
33+
"lint-staged": {
34+
"*.{js,svelte,scss,md}": [
35+
"prettier -w --plugin-search-dir=.",
36+
"git add"
37+
],
38+
"*.{js,svelte}": [
39+
"eslint --ext .svelte,.js --fix",
40+
"git add"
41+
],
42+
"*.scss": [
43+
"stylelint --syntax scss --fix",
44+
"git add"
45+
]
46+
},
2747
"engines": {
2848
"node": ">=12.x"
2949
},
3050
"dependencies": {
31-
"husky": "^4.2.5"
51+
"husky": "^4.2.5",
52+
"lint-staged": "^10.2.13"
53+
},
54+
"devDependencies": {
55+
"babel-eslint": "^10.1.0",
56+
"concurrently": "^5.3.0",
57+
"eslint": "^7.6.0",
58+
"eslint-config-airbnb-base": "^14.2.0",
59+
"eslint-plugin-import": "^2.22.0",
60+
"eslint-plugin-svelte3": "^2.7.3",
61+
"prettier": "^2.1.1",
62+
"prettier-plugin-svelte": "^1.2.0",
63+
"stylelint": "^13.6.1",
64+
"stylelint-config-standard": "^20.0.0",
65+
"stylelint-scss": "^3.18.0"
3266
}
3367
}

packages/docs/.eslintrc.js

-13
This file was deleted.

packages/docs/package.json

+1-17
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,7 @@
66
"dev": "sapper dev --ext \".svelte .svx\"",
77
"build": "sapper build --legacy --ext \".svelte .svx\"",
88
"export": "sapper export --legacy --ext \".svelte .svx\"",
9-
"start": "node __sapper__/build",
10-
"precommit": "lint-staged",
11-
"lint": "eslint . --ext .svelte,.js",
12-
"lint:fix": "eslint . --ext .svelte,.js --fix"
13-
},
14-
"lint-staged": {
15-
"src/**/*.{js,svelte}": [
16-
"eslint --ext .svelte,.js --fix",
17-
"git add"
18-
]
9+
"start": "node __sapper__/build"
1910
},
2011
"dependencies": {
2112
"@mdi/js": "^5.5.55",
@@ -38,13 +29,6 @@
3829
"@rollup/plugin-node-resolve": "^9.0.0",
3930
"@rollup/plugin-replace": "^2.2.0",
4031
"autoprefixer": "^9.8.6",
41-
"babel-eslint": "^10.1.0",
42-
"deepmerge": "^4.2.2",
43-
"eslint": "^7.6.0",
44-
"eslint-config-airbnb-base": "^14.2.0",
45-
"eslint-plugin-import": "^2.22.0",
46-
"eslint-plugin-svelte3": "^2.7.3",
47-
"lint-staged": "^10.2.13",
4832
"mdsvex": "^0.8.6",
4933
"postcss": "^7.0.32",
5034
"prismjs": "^1.21.0",

packages/svelte-materialify/.eslintignore

-2
This file was deleted.

packages/svelte-materialify/.eslintrc.js

-1
This file was deleted.

packages/svelte-materialify/package.json

-26
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,10 @@
1313
"css": "sass src/styles/_global.scss:dist/global.css -I theme -s compressed --no-source-map",
1414
"watch:css": "npm run css -- --watch",
1515
"test": "jest",
16-
"precommit": "lint-staged",
17-
"lint": "concurrently \"npm:lint:css\" \"npm:lint:js\"",
18-
"lint:fix": "concurrently \"npm:lint:css:fix\" \"npm:lint:js:fix\"",
19-
"lint:css": "stylelint src/**/*.scss --syntax scss",
20-
"lint:css:fix": "stylelint src/**/*.scss --syntax scss --fix",
21-
"lint:js": "eslint . --ext .svelte,.js",
22-
"lint:js:fix": "eslint . --ext .svelte,.js --fix",
2316
"check": "svelte-check --workspace src/components",
2417
"version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1 && git add CHANGELOG.md",
2518
"release": "np"
2619
},
27-
"lint-staged": {
28-
"src/**/*.{js,svelte}": [
29-
"eslint --ext .svelte,.js --fix",
30-
"git add"
31-
],
32-
"src/**/*.scss": [
33-
"stylelint --syntax scss --fix",
34-
"git add"
35-
]
36-
},
3720
"np": {
3821
"branch": "master",
3922
"cleanup": false,
@@ -48,25 +31,16 @@
4831
"@testing-library/jest-dom": "^5.11.4",
4932
"@testing-library/svelte": "^3.0.0",
5033
"autoprefixer": "^9.8.6",
51-
"babel-eslint": "^10.1.0",
5234
"babel-jest": "^26.2.2",
5335
"concurrently": "^5.3.0",
5436
"conventional-changelog-cli": "^2.0.34",
55-
"eslint": "^7.6.0",
56-
"eslint-config-airbnb-base": "^14.2.0",
57-
"eslint-plugin-import": "^2.22.0",
58-
"eslint-plugin-svelte3": "^2.7.3",
5937
"jest": "^26.4.2",
60-
"lint-staged": "^10.2.13",
6138
"np": "^6.5.0",
6239
"postcss": "^7.0.32",
6340
"rollup": "^2.26.8",
6441
"rollup-plugin-svelte": "^6.0.0",
6542
"rollup-plugin-terser": "^7.0.1",
6643
"sass": "^1.26.10",
67-
"stylelint": "^13.6.1",
68-
"stylelint-config-standard": "^20.0.0",
69-
"stylelint-scss": "^3.18.0",
7044
"svelte": "^3.24.1",
7145
"svelte-check": "^1.0.30",
7246
"svelte-htm": "^1.1.1",

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -6855,11 +6855,21 @@ [email protected]:
68556855
resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-1.1.0.tgz#e6ec282d8457598b0c02164083b11ad8cb8ab304"
68566856
integrity sha512-wmIggG/ryV0wcmE9D5p+k5TwKDpS2SGKJpF6IV1aYHK7dkBJD+di1w47Ci00DRsI4RrXZRC2Ef37DSyrTb6Zqg==
68576857

6858+
prettier-plugin-svelte@^1.2.0:
6859+
version "1.2.0"
6860+
resolved "https://registry.yarnpkg.com/prettier-plugin-svelte/-/prettier-plugin-svelte-1.2.0.tgz#64088163656470e7d5c83106aea804a1c2c71efb"
6861+
integrity sha512-D6Yh8WIk/8BDtJ6BN5vFMylCcdbiQbB2px5UPIiBCp1MbEqpEbVfWyOJPKnVc0xkvlr2CoCRXJcNbHtnh0JM9w==
6862+
68586863
68596864
version "2.0.5"
68606865
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
68616866
integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==
68626867

6868+
prettier@^2.1.1:
6869+
version "2.1.1"
6870+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6"
6871+
integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==
6872+
68636873
pretty-format@^25.2.1, pretty-format@^25.5.0:
68646874
version "25.5.0"
68656875
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a"

0 commit comments

Comments
 (0)