Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
fix: Eslint not running on lint staged (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopedrodcf authored Aug 11, 2021
1 parent 7570581 commit 4b9c92f
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 341 deletions.
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": ["import", "node", "monorepo", "@typescript-eslint"],
"plugins": ["import", "node", "monorepo", "@typescript-eslint", "prettier"],
"rules": {
"node/no-extraneous-require": ["error"],
"node/no-extraneous-import": ["error"],
Expand All @@ -16,5 +16,9 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
}
},
"extends": [
"plugin:prettier/recommended",
"prettier"
]
}
7 changes: 7 additions & 0 deletions garment.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@
"tspackage": {
"extends": "publishable",
"tasks": {
"lint": [
{
"runner": "eslint",
"input": "{{projectDir}}/src/**/*.+(t|j)s?(x)",
"output": "{{projectDir}}/src"
}
],
"clean": {
"runner": "clean",
"input": "{{projectDir}}/lib/**/*"
Expand Down
6 changes: 3 additions & 3 deletions local_garment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@garment/cli": "^0.13.14",
"@garment/plugin-runner-clean": "^0.13.13",
"@garment/plugin-runner-ts": "^0.13.13"
"@garment/cli": "^0.16.0",
"@garment/plugin-runner-clean": "^0.16.0",
"@garment/plugin-runner-ts": "^0.16.0"
}
}
457 changes: 126 additions & 331 deletions local_garment/yarn.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build:ci": "yarn gr build --ts.configFile tsconfig.ci.json",
"watch": "yarn gr build --watch",
"clean": "yarn gr clean",
"lint": "echo Everything seems good!",
"lint": "yarn gr lint",
"test": "yarn gr test",
"test-debug": "node --inspect-brk local_garment/node_modules/.bin/garment test --runInBand",
"bump": "lerna version -m 'chore: Release' --conventional-commits",
Expand All @@ -32,6 +32,8 @@
"eslint-plugin-import": "^2.15.0",
"eslint-plugin-monorepo": "0.2.1",
"eslint-plugin-node": "8.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"husky": "^1.3.1",
"lerna": "^3.7.1",
"lerna-update-wizard": "^0.16.0",
Expand All @@ -49,7 +51,7 @@
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix",
"git add"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ Object {
"args": Array [
"
/test_path/test/index.js
1:13 error Insert \`;⏎\` prettier/prettier
1:13 error Missing semicolon semi
",
],
"level": "error",
},
Object {
"args": Array [
"
/test_path/test/foo.js
1:9 error Replace \`\\"Im·still·using·vars\\";\` with \`'Im·still·using·vars';⏎\` prettier/prettier
1 error and 0 warnings potentially fixable with the \`--fix\` option.
",
],
Expand All @@ -27,6 +38,7 @@ Object {
"
/test_path/test/foo.js
1:1 warning Unexpected var, use let or const instead no-var
1 error and 0 warnings potentially fixable with the \`--fix\` option.
",
],
"level": "warn",
Expand All @@ -41,12 +53,14 @@ exports[`Emits fixed files 1`] = `
Object {
"collectedOutput": Array [
Object {
"data": "const a = 10;",
"data": "const a = 10;
",
"path": "index.js",
"type": "text",
},
Object {
"data": "let a = \\"Im still using vars\\";",
"data": "let a = 'Im still using vars';
",
"path": "foo.js",
"type": "text",
},
Expand Down Expand Up @@ -82,8 +96,9 @@ Object {
"args": Array [
"
/test_path/test/index.js
1:13 error Insert \`;⏎\` prettier/prettier
1:13 error Missing semicolon semi
1 error and 0 warnings potentially fixable with the \`--fix\` option.
",
],
"level": "error",
Expand Down
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7637,6 +7637,11 @@ escodegen@^1.9.1:
optionalDependencies:
source-map "~0.6.1"

[email protected]:
version "8.3.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==

eslint-import-resolver-node@^0.3.2:
version "0.3.3"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz#dbaa52b6b2816b50bc6711af75422de808e98404"
Expand Down Expand Up @@ -7704,6 +7709,13 @@ [email protected]:
resolve "^1.8.1"
semver "^5.5.0"

[email protected]:
version "3.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7"
integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-scope@^4.0.0, eslint-scope@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
Expand Down Expand Up @@ -8146,6 +8158,11 @@ fast-deep-equal@^3.1.1:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4"
integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==

fast-diff@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==

fast-glob@^2.0.2, fast-glob@^2.2.6:
version "2.2.7"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d"
Expand Down Expand Up @@ -14007,6 +14024,13 @@ preserve@^0.2.0:
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=

prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"

prettier-package-json@^2.1.0:
version "2.1.3"
resolved "https://registry.yarnpkg.com/prettier-package-json/-/prettier-package-json-2.1.3.tgz#c2383552aa226abe7a8a1b289d7844ffc8440d71"
Expand Down

0 comments on commit 4b9c92f

Please sign in to comment.