diff --git a/.husky/commit-msg b/.husky/commit-msg index babe8fa8f..4c80ab244 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,3 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" yarn commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit index d2ae35e84..c41c405fb 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,3 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" yarn lint-staged diff --git a/.husky/pre-push b/.husky/pre-push index a330e76da..51fe788e8 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,5 +1,4 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" yarn pack yarn test diff --git a/.ls-lint.yml b/.ls-lint.yml new file mode 100644 index 000000000..e33afb17f --- /dev/null +++ b/.ls-lint.yml @@ -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 \ No newline at end of file diff --git a/.mega-linter.yml b/.mega-linter.yml index 1ec99fa17..bcdd6d74d 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -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 diff --git a/__tests__/unit/lib/service/diffLineInterpreter-compatibility.test.ts b/__tests__/unit/lib/service/diffLineInterpreterCompatibility.test.ts similarity index 100% rename from __tests__/unit/lib/service/diffLineInterpreter-compatibility.test.ts rename to __tests__/unit/lib/service/diffLineInterpreterCompatibility.test.ts diff --git a/package.json b/package.json index fc02fe6fc..3b5f97335 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ }, "author": "Sebastien Colladon ", "dependencies": { + "@ls-lint/ls-lint": "^2.2.3", "@salesforce/command": "^5.3.9", "@salesforce/core": "^7.4.0", "async": "^3.2.5", @@ -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", @@ -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": { @@ -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": [ @@ -106,7 +116,10 @@ "**/.eslint*", "**/tsconfig.json" ], - "output": [] + "output": [], + "dependencies": [ + "lint:fs" + ] }, "lint:dependencies": { "command": "knip", @@ -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": [ diff --git a/yarn.lock b/yarn.lock index 63bc44e8f..125bccae3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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