Maxime LUCE
0cf5511ae0
[feat] Add errorMode option to compile to allow continuing on errors (and mark them as warnings) ( #6194 )
...
This PR adds a new option errorMode to CompileOptions to allow continuing the compilation process when errors occured.
When set to warn, this new option will indicate to Svelte that it should log errors as warnings and continue compilation.
This allows (notably) preprocessors to compile the markup to detect vars in markup before preprocessing (in this case: script and style tags are stripped so it can produce a lot of errors).
This PR is part of a work on the svelte-preprocess side to improve the preprocessing of TypeScript files: https://github.com/sveltejs/svelte-preprocess/issues/318
- allow compiler to pass error as warnings
- enforce stops after errors during compilation (for type-checking, TS doesn't know the error method throws)
- should review Element.ts:302
- added a test case for errorMode
- added documentation
3 years ago
Tan Li Hau
fd031105aa
[fix] do not warn if module variables are not the only dependencies in reactive statements ( #6510 )
...
The warning was too strict, since there are valid use cases for having non-reactive variables inside reactive statements
Fixes #5954
3 years ago
Simon H
a8c35daa9a
[fix] be able to silence more warnings ( #6504 )
...
including css-unused-selector, unused-export-let, module-script-reactive-declaration
Fixes #5954
Related to #5281
3 years ago
Tan Li Hau
f60cb22a9d
standalone :global() with multiple selectors shouldn't be treated as error ( #6508 )
3 years ago
Geoff Rich
391258aa10
Remove caption warning on <audio> ( #6054 )
3 years ago
Geoff Rich
e73f641ca5
Remove deprecated a11y-no-onchange warning ( #6457 )
3 years ago
Tan Li Hau
fca6a6d38a
:global() with pseudo element should be considered as global ( #6470 )
3 years ago
Tan Li Hau
98ddf8b588
update periscopic ( #6471 )
3 years ago
Ignatius Bagus
8c3fb922d8
only check selector that are direct children of `:global` ( #6435 )
...
* failing test for i6434
* use string match to simplify regexp
* more tests
* separate test suite
* test for commas inside attributes
* stricter regex pattern
* test escaped brackets and parentheses
* change latest test selector to lists
* correct failing test for escaped parentheses
* update with proposed pattern
3 years ago
Anthony Le Goas
58790a9281
a11y: check if mouse events are accompanied by key events ( #5938 )
3 years ago
Dennis Kaspar
b464320607
Add trusted modifier ( #6149 )
...
Fixes #6137
Adding a trusted modifier to make events not be dispatchable by console/sourcecode.
Useful to prevent injected code to automatically dispatch event for preventing botting
3 years ago
Roy Choo
228832c9a3
fix: :global(...):some-pseudoclass should be considered global ( #6317 )
3 years ago
Tan Li Hau
bbcc1e7479
disallow multiple selectors inside :global() ( #6428 )
3 years ago
Térence Hollander
842b8412b6
fix(a11y): do not warn if href value is dynamic ( #6110 )
4 years ago
Tan Li Hau
3d1af7fb68
support :global() in compound selector ( #6223 )
4 years ago
Tan Li Hau
1d6e20f2a9
implement <svelte:fragment> ( #4556 )
...
add validation and test
replace svelte:slot -> svelte:fragment
slot as a sugar syntax
fix eslint
4 years ago
Tan Li Hau
6589aa2548
warn module variables are nonreactive and make them truly nonreactive ( #5847 )
4 years ago
Saurav Sahu
87417e5a7b
fix: "foreign" namespace elements should still allow binding 'this' ( #5942 )
4 years ago
halfnelson
a7eff8894f
add `foreign` namespace to preserve attribute case and skip HTML-specific a11y validations ( #5652 )
4 years ago
Tan Li Hau
2d5d6b05ed
warn if React attributes are used ( #5836 )
4 years ago
Mikail Khan
9745b61aab
fixed typo in each loop animation error ( #5648 )
4 years ago
Andreas Ehrencrona
ddf13211af
Updated to ESLint config 5.4.0 ( #5541 )
4 years ago
Ben McCann
229a16d6e7
upgrade ESLint config ( #5472 )
4 years ago
Tan Li Hau
2d88dc460e
warn for possible use of component without uppercase tag name ( #5302 )
4 years ago
Ben McCann
0645631b28
Use TypeScript in tests ( #5433 )
4 years ago
Tan Li Hau
a1651ca271
add nonpassive event modifier ( #5442 )
...
Co-authored-by: filipot <filipot@stud.ntnu.no>
4 years ago
Tan Li Hau
6e0cd9bcbf
fix missing-declaration warning for use:obj.method ( #5454 )
4 years ago
Tan Li Hau
aef5671411
update acorn and parse expression as module script ( #5423 )
4 years ago
Bassam Ismail
fb51dd8f07
add a11y-media-has-caption check ( #5075 )
4 years ago
Bassam Ismail
62ab75e365
add a11y-label-has-associated-control check ( #5074 )
4 years ago
Bassam Ismail
10f7b5ee70
skip a11y-missing-content check with contenteditable bindings ( #5023 )
4 years ago
pushkin
0da70f46b9
handle line ending differences in tests ( #4915 )
5 years ago
André Lins
f7d1bf35a0
A11y rule no-onchange ( #4788 )
...
* A11y rule no-onchange
* Fix message
* Fix tests
* Removing declarations
5 years ago
Tan Li Hau
37cc5888f8
dry {#each}/{#await} destructuring ( #4596 )
5 years ago
Conduitry
bdabd89f09
fix exception with empty alt attribute ( #4778 )
5 years ago
Doga Genc
ba89c29b98
fix img-reduntant-alt bug ( #4771 )
5 years ago
André Lins
153b128fe2
a11y: implement img-redundant-alt ( #4750 )
5 years ago
André Lins
07242f994c
a11y: do not warn about <a name> / <a id> ( #4739 )
5 years ago
Kalan
56d1af493b
a11y: warn about href="javascript:..." ( #4733 )
5 years ago
Daniel Imfeld
ddfb751fc9
prevent illegal attribute names at compile time ( #4650 )
5 years ago
Tan Li Hau
77ec48deba
add await catch shorthand ( #4490 )
5 years ago
Tan Li Hau
5bb5ba4c76
complain if named slots other than direct descendant of component ( #4509 )
5 years ago
vlasy
e06a900b23
throw compiler error when binding directly to const variables ( #4506 )
5 years ago
Tan Li Hau
fdc89ebb62
warn if component is expected to be reactive ( #4409 )
5 years ago
Conduitry
f5f489984f
fix handling of reserved keywords when parsing ( #4390 )
5 years ago
Tan Li Hau
527ddea289
disallow binding variables declared in await and catch
5 years ago
burningTyger
b9368d5de4
remove quotes from code suggestion
5 years ago
David Kondrad
6b5a4870df
tests: validator: add support for customElement compile option + test cases ( #4133 )
5 years ago
Benjamin W. Broersma
3433418dce
Skip JS globals for InlineComponent nodes in warn_if_undefined. ( #4071 )
5 years ago
Conduitry
e996ef750d
fix warnings for props that are only used as stores ( #4021 )
5 years ago