Skip to content

Commit 63236bd

Browse files
committed
chore(eslint): run ESLint through yarn workspaces
This way we can use @babel/eslint-parser and it will the the .babelrc config file from the workspace.
1 parent 6989ce1 commit 63236bd

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@
44
"scripts": {
55
"build": "yarn workspaces run build",
66
"test": "yarn workspaces run test",
7-
"lint": "eslint src/*/Resources/assets/{src,test}/*.js --fix",
7+
"lint": "yarn workspaces run lint --fix",
88
"format": "prettier src/*/Resources/assets/{src,test}/*.js {,src/*/}*.{json,md} --write",
99
"check-lint": "yarn lint --no-fix",
1010
"check-format": "yarn format --no-write --check"
1111
},
1212
"devDependencies": {
13-
"eslint": "^7.15.0",
1413
"@babel/eslint-parser": "^7.12.1",
14+
"eslint": "^7.15.0",
1515
"eslint-config-prettier": "^6.15.0",
16+
"eslint-plugin-jest": "^24.1.3",
1617
"prettier": "^2.2.1"
1718
},
1819
"eslintConfig": {
1920
"root": true,
20-
"parserOptions": {
21-
"sourceType": "module",
22-
"ecmaVersion": 11
23-
},
21+
"parser": "@babel/eslint-parser",
2422
"extends": [
2523
"eslint:recommended",
2624
"prettier"
25+
],
26+
"env": {
27+
"browser": true
28+
},
29+
"overrides": [
30+
{
31+
"files": ["src/*/Resources/assets/test/*.js"],
32+
"extends": ["plugin:jest/recommended"]
33+
}
2734
]
2835
},
2936
"prettier": {

src/Chartjs/Resources/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"scripts": {
1616
"build": "babel src -d dist",
17-
"test": "babel src -d dist && jest"
17+
"test": "babel src -d dist && jest",
18+
"lint": "eslint src test"
1819
},
1920
"dependencies": {
2021
"chart.js": "^2.9.4"

src/Cropperjs/Resources/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
},
1919
"scripts": {
2020
"build": "babel src -d dist",
21-
"test": "babel src -d dist && jest"
21+
"test": "babel src -d dist && jest",
22+
"lint": "eslint src test"
2223
},
2324
"dependencies": {
2425
"cropperjs": "^1.5.9"

src/Dropzone/Resources/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"scripts": {
1919
"build": "babel src -d dist",
20-
"test": "babel src -d dist && jest"
20+
"test": "babel src -d dist && jest",
21+
"lint": "eslint src test"
2122
},
2223
"peerDependencies": {
2324
"stimulus": "^2.0.0"

src/LazyImage/Resources/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"scripts": {
1616
"build": "babel src -d dist",
17-
"test": "babel src -d dist && jest"
17+
"test": "babel src -d dist && jest",
18+
"lint": "eslint src test"
1819
},
1920
"peerDependencies": {
2021
"stimulus": "^2.0.0"

src/Swup/Resources/assets/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"scripts": {
1616
"build": "babel src -d dist",
17-
"test": "babel src -d dist && jest"
17+
"test": "babel src -d dist && jest",
18+
"lint": "eslint src test"
1819
},
1920
"dependencies": {
2021
"@swup/fade-theme": "^1.0",

0 commit comments

Comments
 (0)