Comments (5)
@fregante commented on April 11, 2022 12:42 AM:
The code is just demo code and it will have to be deleted. It doesn't have to be correct (especially for the lint)
True, but I am seeing the same errors from @typescript-eslint/no-unsafe-assignment
and @typescript-eslint/no-unsafe-call
in my own code after deletion of the demo code, which suggests that there may be some general issue with the combination of a) how the template's extension stack and its dependencies are configured, and b) how its linters are configured. These complaints relating to implicit any
types seem to indicate that there are some types not getting picked up by eslint. But this is strange, because I can clearly see them in places like node_modules/webext-options-sync/index.d.ts
.
That import you mentioned incorrect, what you're missing are the types for webextension-polyfill.
You mean the import @david-tejada mentioned? I just tried npm add -D @types/webextension-polyfill
but it didn't eliminate any of the linting errors. And if that is indeed needed in other circumstances, wouldn't it be worth mentioning in the readme.md
in the paragraph about Typescript?
The last error is most likely a eslint cache error unfortunately, nothing I can fix.
Yeah, no worries - just thought I'd mention it in case you'd seen that weirdness before.
from browser-extension-template.
I can see now that importing browser like I did doesn't make any difference. I changed it back too import browser from "webextension-polyfill";
and I get no errors. Maybe it was something that I did before adding tsconfig.json
and seemed to work. Anyway, you can check out my package.json to see if you're missing something. I got no linting errors here
from browser-extension-template.
I got rid of those errors using this line to import browser:
import * as browser from "webextension-polyfill";
from browser-extension-template.
The code is just demo code and it will have to be deleted. It doesn't have to be correct (especially for the lint)
That import you mentioned incorrect, what you're missing are the types for webextension-polyfill.
The last error is most likely a eslint cache error unfortunately, nothing I can fix.
from browser-extension-template.
True, but I am seeing the same errors from
@typescript-eslint/no-unsafe-assignment
and@typescript-eslint/no-unsafe-call
in my own code after deletion of the demo code
Yeah that's unrelated to anything. Those are just lint rules, you can read their details on the typescript-eslint
repo or you can disable them.
wouldn't it be worth mentioning in the
readme.md
in the paragraph about Typescript?
Absolutely not, using TypeScript here assumes you already know TypeScript. Running tsc
already tells you to install that package.
from browser-extension-template.
Related Issues (20)
- Content scripts injected via chrome.scripting API HOT 2
- Release workflow requires undocumented write access to repository
- Issue with using import in content scripts HOT 5
- importing Image not working from content script HOT 3
- Need to restart the extension to see changes HOT 9
- Unsafe construction of an any type value. HOT 5
- Source maps don't work by default HOT 4
- Document how to convert the project to use TypeScript
- Meta: Firefox deployment failed HOT 2
- Firefox support discussion (MV2, MV3) HOT 15
- erroneous issue, please delete sorry HOT 1
- Chrome Web Store rejection for obfuscated code HOT 4
- Lint css error, fetch tags error, duplicated addon once published HOT 1
- "Template cleanup" workflow broken HOT 1
- Include "popup" in template HOT 1
- Icon greyed out and no functionality HOT 5
- Allow retriggering a store submission HOT 1
- Nested folders in /src HOT 2
- Revisit external sourcemap support, it might be possible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browser-extension-template.