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

Running the run-pre-check.sh script has an error when it tries to run the ESlint linting program #412

Open
eggoynes opened this issue Apr 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@eggoynes
Copy link
Member

Describe the bug

The build-s3-dist.sh works fine for building the solution. But if the HTML code linting script wants to be run which is called run-pre-check.sh in the deployment directory the ESlint command on line 98 of the script fails to run. This started when ESlint was updated to v9.0.0. Nothing has changed in the code, just the program ESlint itself has an error running.

https://github.com/aws-solutions/media-services-application-mapper/blob/main/deployment/run-pre-check.sh#L98

To Reproduce
Steps to reproduce the behavior:

  1. Go to the deployment directory
  2. Run the ./run-pre-check.sh script with no arguments
  3. The script stops on line 98 of the file and says ESlint failed to run because it is unable to read the config file.
@eggoynes eggoynes added the bug Something isn't working label Apr 17, 2024
@eggoynes
Copy link
Member Author

eggoynes commented Apr 17, 2024

The way the ESlint program error can be fixed when running the run-pre-check.py script is to add one line of code before running ESlint and that will cause ESlint v9.0.0 to run successfully.

Put this one export command before the eslint program gets run. Currently eslint is run on line 98 of the code. This export command can be put on line 97.
export ESLINT_USE_FLAT_CONFIG=false

Put the above command before running the ESlint command in the run-pre-check.sh script.
eslint -c .eslintrc.json .

Script located in the deployment folder
deployment/run-pre-check.sh

Before

echo "Eslint Scan started"
npm i -g eslint
cd "$source_dir/html"
eslint -c .eslintrc.json .

After

echo "Eslint Scan started"
npm i -g eslint
cd "$source_dir/html"
export ESLINT_USE_FLAT_CONFIG=false        <--- Add this line here to the run-pre-check.sh script before the eslint command
eslint -c .eslintrc.json .

@eggoynes
Copy link
Member Author

This will be fixed in the next version release of this solution. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant