Skip to content

chore(lint): replace hard-coded separators with path.sep#26549

Merged
mergify[bot] merged 2 commits intoaws:mainfrom
matt9ucci:replace-eslint-hard-sep
Jul 28, 2023
Merged

chore(lint): replace hard-coded separators with path.sep#26549
mergify[bot] merged 2 commits intoaws:mainfrom
matt9ucci:replace-eslint-hard-sep

Conversation

@matt9ucci
Copy link
Copy Markdown
Contributor

@matt9ucci matt9ucci commented Jul 28, 2023

Build on Windows fails due to the hard-coded file path separators ('/') in the eslint rule invalid-cfn-imports.ts.
The error message is "no such file or directory, open 'C:\aws-cdk\tools@aws-cdk\pkglint\bin\pkglint.ts\package.json'" as follows:

$ npx lerna run build --scope=aws-cdk-lib
lerna notice cli v7.1.4
lerna notice filter including "aws-cdk-lib"
lerna info filter [ 'aws-cdk-lib' ]

   ×    1/3 dependent project tasks failed (see below)
   √    2/3 dependent project tasks succeeded [0 read from cache]

 ———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 


> @aws-cdk/pkglint:build

yarn run v1.22.19
$ tsc -b && eslint . --ext=.ts && chmod +x bin/pkglint
DeprecationWarning: 'originalKeywordKind' has been deprecated since v5.0.0 and will no longer be usable after v5.2.0. Use 'identifierToKeywordKind(identifier)' instead.

Oops! Something went wrong! :(

ESLint: 7.32.0

Error: Error while loading rule '@aws-cdk/invalid-cfn-imports': ENOENT: no such file or directory, open 'C:\aws-cdk\tools\@aws-cdk\pkglint\bin\pkglint.ts\package.json'
Occurred while linting C:\aws-cdk\tools\@aws-cdk\pkglint\bin\pkglint.ts
    at Object.openSync (node:fs:603:3)
    at Object.readFileSync (node:fs:471:35)
    at isAlphaPackage (C:\aws-cdk\tools\@aws-cdk\eslint-plugin\lib\rules\invalid-cfn-imports.js:139:31)
    at currentFileIsInAlphaPackage (C:\aws-cdk\tools\@aws-cdk\eslint-plugin\lib\rules\invalid-cfn-imports.js:110:16)       
    at Object.create (C:\aws-cdk\tools\@aws-cdk\eslint-plugin\lib\rules\invalid-cfn-imports.js:12:10)
    at createRuleListeners (C:\aws-cdk\node_modules\eslint\lib\linter\linter.js:765:21)
    at C:\aws-cdk\node_modules\eslint\lib\linter\linter.js:937:31
    at Array.forEach (<anonymous>)
    at runRules (C:\aws-cdk\node_modules\eslint\lib\linter\linter.js:882:34)
    at Linter._verifyWithoutProcessors (C:\aws-cdk\node_modules\eslint\lib\linter\linter.js:1181:31)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Replace all with path.sep, cross-platform separator.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jul 28, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team July 28, 2023 12:10
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 28, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: f41053a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 494bb4b into aws:main Jul 28, 2023
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 28, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@matt9ucci matt9ucci deleted the replace-eslint-hard-sep branch July 28, 2023 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants