frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

npx not finding source files

Open Bow2Jesus opened this issue 4 years ago • 1 comments

Using version 1.10.0 - the latest version in Sonatype

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

The npx executor executes the eslint node package but does not list any issues to fix. Instead I get back the "no files found" message.

If the current behavior is a bug, please provide the steps to reproduce.

In your pom file add this execution to the executions for frontend-maven-plugin:

						<execution>
							<id>run eslint</id>
							<goals>
								<goal>npx</goal>
							</goals>
							<phase>process-sources</phase>
							<configuration>
								<arguments>eslint . --ext ts</arguments>
							</configuration>
						</execution>

What is the expected behavior?

A list of errors found in TypeScript files by eslint that need fixing. That is what is produced if I do this by using the npm goal instead of the npx goal like this:

						<execution>
							<id>run eslint</id>
							<goals>
								<goal>npm</goal>
							</goals>
							<phase>process-sources</phase>
							<configuration>
								<arguments>run lint</arguments>
							</configuration>
						</execution>

This runs the following lint script in my package.json file:

    "lint": "eslint . --ext ts",

Please mention your frontend-maven-plugin and operating system version.

frontend-maven-plugin version 1.10.0 Windows 7 eslint version ^7.9.0

Bow2Jesus avatar Sep 29 '20 15:09 Bow2Jesus

Hi,

Does eslint . --ext ts or npm run lint work as expected when run on their own without maven? You could try adding --debug and post the output. That being said: The value you provide to the extension parameter looks suspicious to me. I think you are missing a dot there. And the order of the arguments seems to be wrong. The input files should be last parameter. Please refer to this. You could try this command eslint --ext .ts . Does that work?

holgergp avatar Oct 05 '20 05:10 holgergp