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

ESLint files Pattern #288

Closed
abimaelmartell opened this issue Jun 12, 2020 · 10 comments
Closed

ESLint files Pattern #288

abimaelmartell opened this issue Jun 12, 2020 · 10 comments

Comments

@abimaelmartell
Copy link

When i run npm run lint, i get the following message

> office-addin-lint check


Oops! Something went wrong! :(

ESLint: 6.8.0.

No files matching the pattern "src/**/*.js" were found.
Please check for typing mistakes in the pattern.

I'm writing a taskpane for Excel with Typescript and React.
I haven't changed anything on the eslint configuration.

I'm have this on my package.json

 "office-addin-lint": "^1.0.21",

Thanks.

@akrantz
Copy link
Contributor

akrantz commented Jun 12, 2020

Do you have your sources files in an src folder? Do they have a .js extension?

@abimaelmartell
Copy link
Author

Yeah, i used the generator, so the structure is the default one for the React Typescript project.

Also, the docs mention that the default pattern is src/**/*.{ts,tsx,js,jsx}

Here is an example i created that also fails with the same error on the linter.

https://github.com/abimaelmartell/excel-stock-price-pane

As you can see i have tsx files on the src.

@Keating950
Copy link

Keating950 commented Jun 18, 2020

Usually setting "no-error-on-unmatched-pattern": 0 in .eslintrc.json fixes this, but oddly this issue is persisting for me even after adding it to my project root's config file and the config file found in office-addin-lint/config. (I'm doing the same thing as @abimaelmartell, trying to write a taskpane for Excel with Typescript+React.)

Passing --files src/**/*.{ts,tsx} as an argument still causes ESLint to fail with with the message No files matching the pattern "src/**/*.js" were found.

Running office-addin-lint --files=src/**/*.{ts,tsx} check works.

@LouMM
Copy link
Member

LouMM commented Jul 23, 2020

@abimaelmartell Thank you again for reporting this issue. We are not able to reproduce the issue in house. Are you able to create new add-ins using the template, and they all exhibit the same issue?

@LouMM LouMM closed this as completed Sep 24, 2020
@LouMM
Copy link
Member

LouMM commented Sep 24, 2020

No additional information provided.

@rahulahoop
Copy link

FFR: The true answer is here

office-addin-lint prettier --files="src/**/*.{tsx,ts}"

hth

@akrantz
Copy link
Contributor

akrantz commented Jan 26, 2022

Is the issue here that TypeScript is used and there are no *.js files? @millerds

@akrantz akrantz reopened this Jan 26, 2022
@rahulahoop
Copy link

@akrantz the issue is that the documentation is unclear how to specify which files to scan for the linter option.

@millerds
Copy link
Contributor

millerds commented Jan 27, 2022

@akrantz, the lint command works just fine when there aren't any .js files present (like in the react template repo) so I don't believe it's a case of which files are present

@rahulahoop the lint package did not include a way to customize the linting that is done as it used its own built-in configuration (the local .eslintrc.json files was for the live linting in VS Code or other editors). However, I just finished publishing an update to the lint package that now looks for the local .eslintrc.json file and uses that over the built in one.

I would also note that there have been a number of updates to the linting tools since this issue was originally opened 1.5 years ago. I would like to see the current versions of the packages used to see if the issue continues (without any local .eslintrc.json overrides).

@millerds
Copy link
Contributor

millerds commented Jun 9, 2022

@abimaelmartell @Keating950 @rahulahoop . . . if you are still seeing issues with this using current versions of the templates and script packages please reopen.

@millerds millerds closed this as completed Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants