Skip to content

Commit

Permalink
build: add ls-lint (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon committed Jun 21, 2024
1 parent 1eab3b8 commit 817b469
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 6 deletions.
1 change: 0 additions & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit
1 change: 0 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
1 change: 0 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn pack
yarn test
Expand Down
15 changes: 15 additions & 0 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ls:
.md: lowercase | SCREAMING_SNAKE_CASE
.ts: camelCase | PascalCase
.test.ts: camelCase | PascalCase
.nut.ts: camelCase | PascalCase
.config.ts: camelCase | PascalCase
src:
.dir: kebab-case

ignore:
- .git
- node_modules
- e2e
- lib
- .wireit
1 change: 1 addition & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ DISABLE_LINTERS:
- SPELL_MISSPELL
- TYPESCRIPT_STANDARD
- TYPESCRIPT_PRETTIER
- MARKDOWN_MARKDOWN_LINK_CHECK
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false
# DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass
36 changes: 33 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
"author": "Sebastien Colladon <[email protected]>",
"dependencies": {
"@ls-lint/ls-lint": "^2.2.3",
"@salesforce/command": "^5.3.9",
"@salesforce/core": "^7.4.0",
"async": "^3.2.5",
Expand All @@ -44,13 +45,15 @@
"scripts": {
"build": "wireit",
"clean": "wireit",
"clean:yarn": "wireit",
"dependencies:reinstall": "yarn install",
"dependencies:upgrade": "shx rm -rf yarn.lock ; shx touch yarn.lock ; yarn-upgrade-all ; yarn-audit-fix",
"increment:apiversion": "bash ./tooling/incrementApiVersion.sh",
"lint": "wireit",
"lint:dependencies": "wireit",
"lint:fs": "wireit",
"test": "wireit",
"test:build": "yarn clean ; shx rm -rf .yarn/cache node_modules ; yarn && yarn pack && yarn test",
"test:build": "wireit",
"test:mutation": "wireit",
"test:nut": "wireit",
"test:perf": "wireit",
Expand All @@ -59,7 +62,7 @@
"test:unit:debug:break": "node --inspect-brk node_modules/.bin/jest",
"postpack": "shx rm -f oclif.manifest.json && prettier --write README.md",
"prepack": "yarn build && oclif-dev manifest && oclif-dev readme",
"prepare": "husky install"
"prepare": "husky"
},
"wireit": {
"build": {
Expand All @@ -83,6 +86,13 @@
"perf-result.txt"
]
},
"clean:yarn": {
"command": "shx rm -rf .yarn/cache node_modules",
"files": [
".yarn/cache/*",
"node_modules/*"
]
},
"compile": {
"command": "tsc -p . --incremental",
"files": [
Expand All @@ -106,7 +116,10 @@
"**/.eslint*",
"**/tsconfig.json"
],
"output": []
"output": [],
"dependencies": [
"lint:fs"
]
},
"lint:dependencies": {
"command": "knip",
Expand All @@ -122,12 +135,29 @@
"lint"
]
},
"lint:fs": {
"command": "ls-lint",
"files": [
"src/**",
"__tests__/**/*.ts",
"messages/**",
"**/.ls-lint.yml"
],
"output": []
},
"test": {
"dependencies": [
"test:unit",
"test:nut"
]
},
"test:build": {
"command": "yarn && yarn pack && yarn test",
"dependencies": [
"clean",
"clean:yarn"
]
},
"test:perf": {
"command": "node __tests__/perf/bench.mjs > perf-result.txt && shx cat perf-result.txt",
"files": [
Expand Down
11 changes: 11 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,16 @@ __metadata:
languageName: node
linkType: hard

"@ls-lint/ls-lint@npm:^2.2.3":
version: 2.2.3
resolution: "@ls-lint/ls-lint@npm:2.2.3"
bin:
ls-lint: bin/cli.js
checksum: 8cddee09e78a9bf4499ffac7eaaaaab6dc7d1f7cce1279f75cccb80b21c11f904343e233cbe14b4401132ffee1db08c124d44d5cb6999d01f28ca6e36a8b24e3
conditions: (os=darwin | os=linux | os=win32) & (cpu=x64 | cpu=arm64 | cpu=s390x)
languageName: node
linkType: hard

"@nodelib/fs.scandir@npm:2.1.5":
version: 2.1.5
resolution: "@nodelib/fs.scandir@npm:2.1.5"
Expand Down Expand Up @@ -9909,6 +9919,7 @@ __metadata:
"@commitlint/cli": ^19.3.0
"@commitlint/config-conventional": ^19.2.2
"@jest/globals": ^29.7.0
"@ls-lint/ls-lint": ^2.2.3
"@oclif/dev-cli": ^1.26.10
"@salesforce/cli-plugins-testkit": ^5.3.11
"@salesforce/command": ^5.3.9
Expand Down

0 comments on commit 817b469

Please sign in to comment.