Richard Harris
74fa2447b1
error on empty css declarations - fixes #3801
5 years ago
Tan Li Hau
81c5c480e8
feat: warn unused exports
5 years ago
Richard Harris
ad0e8670ca
tweak text of warning
5 years ago
Tan Li Hau
cfd3b63b9b
warn if using svelte:options tag without compile_options.customElement
5 years ago
Tan Li Hau
5dbb08d19b
allow solo for test suite ( #3747 )
5 years ago
Colin Casey
ee8825d34f
fix reactive declaration cycle detection + clearer error on cycle
...
- fixes #3459
- uses DFS traversal to inspect reactive declarations for cycles
- returns the cycle detected (e.g.; `a → b → a`) for error messaging
5 years ago
Samuel Elgozi
7342d484f1
feat: #3372 added a new `self` event modifier
5 years ago
Rich Harris
e41a4846c3
Merge pull request #3348 from sveltejs/gh-3272
...
throw error if $ is referenced as global
5 years ago
Richard Harris
e3e3ad9be0
disable validation with magic comments
5 years ago
Richard Harris
46cd6ff370
disallow global references to $$-prefixed vars
5 years ago
Richard Harris
4c8f3a296c
throw error if $ is referenced as global - fixes #3272
5 years ago
Rich Harris
cf24dbd6a9
Merge pull request #3336 from Conduitry/gh-3274
...
don't warn when using each index in key
5 years ago
Conduitry
c04def9081
don't warn when using each index in key ( #3274 )
5 years ago
Conduitry
276eb8e553
fix erroneous a11y warning with input type='image' ( #3331 )
5 years ago
Rich Harris
1fc4b1c867
add Error to known globals, declare catch block parameter. fixes #3064
6 years ago
Rich Harris
4e8755338a
oops
6 years ago
Rich Harris
86c5086c54
add some docs, rename to textContent and innerHTML
6 years ago
Richard Harris
8d25f5da0a
Merge branch 'master' of https://github.com/leporo/svelte
6 years ago
Rich Harris
1102ff6426
support once modifier on component events, fail on others ( #2987 )
...
* support once modifier on component events, fail on others. fixes #2654
* appease the gods of typescript
6 years ago
Rich Harris
c1960f9ef8
Merge branch 'master' into master
6 years ago
James Garbutt
caebe0deb8
Introduce ESLint to svelte sources ( #2958 )
...
* introduce eslint
* add lint npm script
* first eslint run
* use tsc stronger checks for unused vars
* fix strict typescript unused checks
* reintroduce unicode oddities
* revert ordering changes
* revert whitespace changes
* set indent lint rule as error and ignore outliers
* revert some more unicode
* reintroduce scissors unicode again
6 years ago
Vlad Glushchuk
450464f014
Add bind:text and bind:html support for contenteditable elements
...
Fixes #310
6 years ago
Emil Tholin
3f31223186
Add error for missing equals after attribute name
6 years ago
Rich Harris
f9a66e558b
failing missing-declaration test
6 years ago
Emil Tholin
0286dce026
Warn on improper use of reactive declarations
6 years ago
Rich Harris
78332cf5b0
Merge pull request #2664 from EmilTholin/each-block-destructuring-rest
...
Add support for object-rest in each destructuring
6 years ago
Rich Harris
16dbb8f437
Merge pull request #2607 from EmilTholin/figcaption_figure_first_element_ancestor
...
Check if a figcaption's first element ancestor is a figure
6 years ago
Emil Tholin
97ee67c08f
Add support for object-rest in each destructuring
6 years ago
Emil Tholin
6ebd72fc22
Check if a figcaption's first element ancestor is a figure
6 years ago
Emil Tholin
7ec1bdb712
Don't show 'Empty block' warnings for non-existent await branches
6 years ago
Richard Harris
cd0f535d83
better error for bindings to let: values - fixes #2301
6 years ago
Richard Harris
30c8fe0c6e
allow reactive declarations without dependencies - fixes #2285
6 years ago
Rich Harris
a59cd36a39
Merge pull request #2321 from sveltejs/gh-2295
...
Fix exception and warning for global variables
6 years ago
Conduitry
ecd7c6e9aa
warn on template references to global variables ( #2295 )
6 years ago
Conduitry
fa79a72348
disallow bindings to global variables ( #2295 )
6 years ago
Rich Harris
16106d113d
handle foreignObject correctly, default to svg namespace for top-level svg elements - fixes #2298
6 years ago
Richard Harris
34c4f79998
augment warnings to help people figure out they need to add a <script>
6 years ago
Richard Harris
73e45ab483
update validate tests
6 years ago
Conduitry
a26b276c5e
update tests
6 years ago
Rich Harris
4541d58798
Add a tutorial ( #2132 )
6 years ago
Richard Harris
248f55a574
move warnings out of stats
6 years ago
Richard Harris
f1d4ff6268
remove onwarn option, just use stats.warnings instead
6 years ago
Richard Harris
871147260c
always warn on empty block - fixes #2042
6 years ago
Rich Harris
206a3d0131
update tests
6 years ago
Rich Harris
687e352209
rename .html files to .svelte
6 years ago
Rich Harris
f64a661fa5
better cyclical dependency detection - fixes #2055
6 years ago
Conduitry
a270661d20
rename `<svelte:meta>` to `<svelte:options>` ( #2017 )
6 years ago
Conduitry
67af1a203e
disallow `slot` as a prop name in inline components ( #2019 )
6 years ago
Rich Harris
b1d919f3f2
Overhaul stats — closes #1891
6 years ago
Rich Harris
c2e6d1bf0d
Better composition — implements https://github.com/sveltejs/rfcs/pull/12
6 years ago
Richard Harris
88c674079b
always use stats.warn instead of options.onwarn - fixes #1918
6 years ago
Rich Harris
48f1f6b4d0
implement `bind:this`
6 years ago
Rich Harris
f45e2b70fd
Implement reactive assignments ( #1839 )
...
This also includes elements of RFCs 2 and 3
6 years ago
Rich Harris
b3b95d4ee6
disallow passive|preventDefault combo
6 years ago
Rich Harris
8ec02b336d
disallow once/passive in legacy mode, for now
6 years ago
Rich Harris
aa203973e0
add some more modifier validation tests
6 years ago
Rich Harris
769e03296f
merge master -> gh-1088
6 years ago
Rich Harris
945134bc81
warn on unused helpers - fixes #1704
6 years ago
Rich Harris
c52a6f011b
dont warn on empty block for nbsp - fixes #1658
6 years ago
Admin
7c4b9a5a41
Changes stop and prevent to stopPropagation and preventDefault
6 years ago
Rich Harris
401a6fea5d
handle single identifiers in {@debug} tags
6 years ago
Admin
4004a569e1
Adds tests for valid and invalid debug tag usage.
6 years ago
Admin
adfc0e3e45
Adds invalid test for event-modifiers.
6 years ago
Admin
a3c71af5c5
Changes {@debug _ } to {@debug}
6 years ago
Admin
622e7b0190
Adds debug all option to debug tag
6 years ago
Admin
89412e370e
Adds validation for invalid reference names like foo-bar.
6 years ago
Christian Kaisermann
19d541ab77
Add refs.* to valid event handler callees warning message
7 years ago
Conduitry
5e8a8b95e5
update some stray references to v1 syntax
7 years ago
Rich Harris
94206ca439
add animation validation tests
7 years ago
Rich Harris
4a67542bec
prevent bind:offsetWidth etc on void elements
7 years ago
Rich Harris
fe4637305b
add validation logic, error on dimension bindings for SVG elements
7 years ago
Rich Harris
aaab6853ce
support $method(...) calls, and warn on store.method(...)
7 years ago
Rich Harris
5a457bfb87
rename loc to start, include character info in locations
7 years ago
Rich Harris
b9fcc16d68
update test
7 years ago
Rich Harris
73e83e5571
tidy up
7 years ago
Rich Harris
cae4dd93bf
fix some more tests
7 years ago
Rich Harris
39ad124c99
update validation tests
7 years ago
Rich Harris
1143b0a991
remove v1 tests
7 years ago
Rich Harris
80e0dceb9a
remove validate and Stylesheet from public API
7 years ago
Rich Harris
c1573dbf2c
implement onstate and onupdate
7 years ago
Rich Harris
410f44dced
Merge branch 'master' into gh-1197
7 years ago
Rich Harris
33afb7e49a
add some onstate/onupdate tests
7 years ago
Rich Harris
35f4a1f063
add codes to errors
7 years ago
Rich Harris
b86a1edb52
add codes to validation errors
7 years ago
Rich Harris
f0b2cb99f2
add codes to warnings ( #474 )
7 years ago
Rich Harris
813e077ccc
Merge pull request #1330 from sveltejs/gh-1318
...
implement syntax changes
7 years ago
Rich Harris
0edbac615c
add validator tests
7 years ago
Rich Harris
032083bb34
fix #1331
7 years ago
Rich Harris
0ebe5355e1
Merge pull request #1299 from sveltejs/gh-1257
...
Stats
7 years ago
Rich-Harris
dfc8462d98
fail validation if bound <select> has dynamic multiple attribute - fixes #1270
7 years ago
Rich-Harris
c0287f2080
include warnings in stats object
7 years ago
Josh Duff
864fd313bb
Accept backtick string literals in tag/props properties
7 years ago
Jacob Wright
04f5d5c975
Adds actions to components
...
Actions add additional functionality to elements within your component's template that may be difficult to add with other mechanisms. Examples of functionality which actions makes trivial to attach are:
* tooltips
* image lazy loaders
* drag and drop functionality
Actions can be added to an element with the `use` directive.
```html
<img use:lazyload data-src="giant-photo.jpg>
```
Data may be passed to the action as an object literal (e.g. `use:b="{ setting: true }"`, a literal value (e.g. `use:b="'a string'"`), or a value or function from your component's state (e.g. `add:b="foo"` or `add:b="foo()"`).
Actions are defined in a "actions" property on your component definition.
```html
<script>
export default {
actions: {
b(node, data) {
// do something
return {
update(data) {},
destroy() {}
}
}
}
}
</script>
```
A action is a function which receives a reference to an element and optionally the data if it is added in the HTML. This function can then attach listeners or alter the element as needed. The action can optionally return an object with the methods `update(data)` and `destroy()`.
When data is added in the HTML and comes from state, the action's `update(data)` will be called if defined whenever the state is changed.
When the element is removed from the DOM `destroy()` will be called if provided, allowing for cleanup of event listeners, etc.
See https://github.com/sveltejs/svelte/issues/469 for discussion around this feature and more examples of how it could be used.
7 years ago
James Birtles
89024177fc
Fix named-export end position
7 years ago
James Birtles
da6a74016f
add end position to errors
7 years ago
James Birtles
d07721cd50
add end position to warnings
7 years ago
Rich Harris
fdd9adab4d
add test for #1179
7 years ago
Rich Harris
f77314f647
increase test coverage
7 years ago
Rich Harris
bc6ee3ef9f
increase test coverage, handle immediately-closed blocks
7 years ago
Rich Harris
198f132b28
doh
7 years ago
Rich Harris
ff67b137c4
empty blocks are a dev warning, not an error
7 years ago
Rich Harris
d0be845190
Merge pull request #1106 from sveltejs/gh-1083
...
Enforce valid names for computed properties
7 years ago
Conduitry
49135161bc
do not run a11y validation on child component elements ( #1110 )
7 years ago
Rich Harris
b19303679d
simplify test slightly, add test for reserved words
7 years ago
Rich Harris
146327e87f
fix expected error position, tweak expected message to include suggested alternative
7 years ago
Rich Harris
cfdc8902ab
run prettier (spaces -> tabs)
7 years ago
asweingarten
02afdb03fa
[1083] Svelte should throw a compile time error when illegal characters are used in computed names
...
Approach:
For each property name, construct a string that defines a function and see if parsing that string with Acorn throws an exception.
If it does, assemble an informative error message that states which property is invalid, the first invalid character, and the location of that character within the name.
Changes to codebase:
- Added new validator test
"properties-computed-must-be-valid-function-names"
- Added new check into src/validate/js/propValidators/computed.ts,
"checkForValidIdentifiers"
- this check was added to
src/validate/js/utils/checkForValidIdentifiers.ts like the other
checks in "computed.ts"
7 years ago
Rich Harris
5fea63a5de
validate contents of await blocks ( #1061 )
7 years ago
Emil Ajdyna
5659d10d7c
Allow xlink:href attribute
7 years ago
Rich Harris
b7d8c49dc8
Merge branch 'master' into gh-1027
7 years ago
Rich Harris
646b0c0e01
optimise <title> - fixes #1027
7 years ago
Rich Harris
ab94066932
warn on unused events/transitions - fixes #1051
7 years ago
Rich Harris
146f645502
detect unused/misplaced components - closes #1039
7 years ago
Rich Harris
4b87d20b93
tweak error wording slightly
7 years ago
Emil Ajdyna
d561c93841
Check against this usage in computed functions
7 years ago
Rich Harris
0be3211c4f
fix figcaption a11y warning - fixes #996
7 years ago
Rich Harris
a87d30e0e6
allow event handlers to call store methods
7 years ago
Rich Harris
c9aa72313e
throw error on illegal context ( #934 )
7 years ago
Rich Harris
0a01aa0243
Increase code coverage
7 years ago
Rich Harris
60b883b066
enable <:Window bind:online/> - fixes #936 ( #937 )
7 years ago
Rich Harris
bcae68de06
treat quoted property names the same way as identifiers - fixes #914
7 years ago
Conduitry
cc8614c51c
allow options.* as event handler callee
7 years ago
Rich Harris
64026c3ba9
Merge pull request #854 from sveltejs/gh-782
...
allow console.* calls in event handlers
7 years ago
Rich Harris
d5ad4c007b
update validation message
7 years ago
Rich Harris
9b505de3a0
compile time error on slotted content inside if/each blocks. closes #849
7 years ago
Conduitry
40ae4a42c1
fix a11y-html-has-lang unit test
7 years ago
Rich Harris
c872234a4b
Update input.html
7 years ago
jpsc
8639359aa7
feat(a11y): add warning missing lang on html tag
7 years ago
Rich Harris
7c6ea13689
reenable all tests, fix some failures
7 years ago
Rich Harris
85e9ed9a81
tabindex-no-positive
7 years ago
Rich Harris
915c1835a4
scope
7 years ago
Rich Harris
b3409ad405
no-distracting-elements
7 years ago
Rich Harris
81c5a1fb3b
no-autofocus
7 years ago
Rich Harris
d5b8d2fd48
no-access-key
7 years ago
Rich Harris
2364f6a04d
heading-has-content
7 years ago
Rich Harris
c62a74e8ae
aria-role
7 years ago
Rich Harris
125191a843
aria-props
7 years ago
Rich Harris
073cbc0460
update some tests
7 years ago
Rich Harris
6133976fec
anchor-is-valid
7 years ago
Rich Harris
bacbaef868
anchor-has-content
7 years ago
Rich Harris
51c2e0581b
a11y checks ( #374 )
7 years ago
Rich Harris
502f6b6d14
Merge pull request #793 from sveltejs/gh-791
...
error if component has transition
7 years ago
Rich Harris
cb92f3028e
error if component has transition ( fixes #791 )
7 years ago
Rich Harris
5b3e8cd88f
support nested <slot> elements
7 years ago
Rich Harris
a023346c91
validation
7 years ago
Rich Harris
c1f34e3e2a
validate ref callees ( #686 )
8 years ago
Rich Harris
03a9ce353a
fix tests
8 years ago
Rich Harris
65e27c98a0
reduce duplication by moving validation into stylesheet
8 years ago
Rich Harris
2c9fb31a9e
simplify tests
8 years ago
Rich Harris
5499327a70
refactoring, and more :global(...) fixes
8 years ago