Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

matt9ucci
Copy link
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
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
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
9 checks passed
@mergify
Copy link
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.

None yet

3 participants