JavaScript project linting failed : no .ts files found
See original GitHub issue- I am running the latest version of Node and the tools
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
Thank you for your help! 🙏
Expected behavior
When generating a new project with only HTML (taskpane) and JavaScript, linting should not throw error because no .ts files were found.
Current behavior
If trying to lint with npm run lint
just after HTML and JS project generation, I get this error: No files matching the pattern "src/**/*.ts" were found.
Steps to Reproduce
- Start a new project with
yo office --projectType taskpane --name "office-add-in" --host outlook --js true
. - Install packages
npm i
. - Run lint
npm run lint
- Error :
No files matching the pattern "src/**/*.ts" were found.
Context
- Operating System: Mac OS Catalina 10.15.7
- Node version: 14.15.0
- Tool version:3.1.1 (
yo office --version
) - Office version: Where do I get the info? I’ve just installed Office and updated it from “Fast” to be able to use new Microsoft Preview’s APIs.
Failure Logs
Terminal
npm run lint
> office-addin-taskpane-js@0.0.1 lint /Users/dimitri/Desktop/the-project
> office-addin-lint check
Oops! Something went wrong! :(
ESLint: 6.8.0.
No files matching the pattern "src/**/*.ts" were found.
Please check for typing mistakes in the pattern.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! office-addin-taskpane-js@0.0.1 lint: `office-addin-lint check`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the office-addin-taskpane-js@0.0.1 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
package.json
...
"scripts": {
...
"lint": "office-addin-lint check",
"lint:fix": "office-addin-lint fix",
...
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/polyfill": "^7.11.5",
"@babel/preset-env": "^7.11.5",
"babel-loader": "^8.1.0",
"chai": "^4.2.0",
"clean-webpack-plugin": "^3.0.0",
"codecov": "^3.8.1",
"copy-webpack-plugin": "^6.1.1",
"dirty-chai": "^2.0.1",
"eslint": "^7.13.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-office-addins": "^1.0.19",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"file-loader": "^4.2.0",
"find-process": "^1.4.3",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.5.0",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"office-addin-cli": "^1.0.13",
"office-addin-debugging": "^3.0.34",
"office-addin-dev-certs": "^1.5.5",
"office-addin-lint": "^1.0.26",
"office-addin-manifest": "1.5.7",
"office-addin-prettier-config": "^1.0.12",
"source-map-loader": "^0.2.4",
"typescript": "^4.0.5",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"prettier": "office-addin-prettier-config"
},
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Eslint unable to find errors on .ts files - Stack Overflow
Running npm run lint it cant find any errors even there is clearly an error to a .ts file. It only can detect...
Read more >Working with JavaScript in Visual Studio Code
This enables type checking for all JavaScript files in the project. You can use // @ts-nocheck to disable type checking per file. JavaScript...
Read more >ESLint | WebStorm Documentation - JetBrains
WebStorm integrates with ESLint which brings a wide range of linting rules that can also be extended with plugins.
Read more >Linting JavaScript in Visual Studio - Microsoft Learn
In this article. Enabling linting support; Installing ESLint dependencies; Disabling linting rules and auto-fixes; Troubleshooting.
Read more >A Complete Guide to Using TypeScript in Node.js - Better Stack
Setting up linting and formatting for TypeScript files. ... error TS18003: No inputs were found in config file '/home/ayo/dev/demo/btc/tsconfig.json'.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
office-addin-lint is using eslint. We wanted a way to be able to update recommended configs for Office Addins over time without just directly doing it in the add-in project, and make it simple to use. You can still fully customize the eslint config in the project.
It looks like the JavaScript project might not have been updated properly and it is using the file specifier that is appropriate for TypeScript. @TCourtneyOwen it looks like Office-Addin-TaskPane-JS has not been merged properly because I see a bunch of TypeScript stuff in the package.json. Could you take a look?
I am indeed able to repro this issue on Mac, and confirmed it’s specific to Mac
If I update our linting script in Office-Add-Taskpane, for example, to the following, it works on Mac:
“lint”: “office-addin-lint check --files “src/**/*.ts””,
So it seems to me that the problem lies in reading the default value of “src/**/*.{ts,tsx,js,jsx}”
I think it’s the “{. }” around the extensions is causing problems