Skip to content
This repository was archived by the owner on Sep 24, 2021. It is now read-only.

Initial commit of Analyzer-based Linter. Ported over first linter 'unbalanced-delimiters' #1

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions test/sample/imports/a11y-attributes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="a11y-attributes">
<template>
<div
role="textbox"
aria-required$="[[required]]"
aria-label="[[label]]"
>
</div>
</template>
</dom-module>

<script>
Polymer({
is: 'a11y-attributes',
properties: {
required: Boolean,
label: String
}
});
</script>
30 changes: 30 additions & 0 deletions test/sample/imports/bound-variables-declared.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="bound-variables-declared">
<template>
<span>[[myVar]]</span>
<span>{{myVars}}</span>
</template>
</dom-module>

<script>
Polymer({
is: 'bound-variables-declared',
properties: {
/**
* A super nifty property.
*/
myVars: {
type: String,
value: 'Hello linter!'
}
}
});
</script>
30 changes: 30 additions & 0 deletions test/sample/imports/compound-binding.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="compound-binding">
<template>
<span>[[nested]]</span>
<span>{{nested.this.that.other}}</span>
<span>{{!nestedz}}</span>
</template>
</dom-module>

<script>
Polymer({
is: 'compound-binding',
properties: {
/**
* A super nifty property.
*/
nested: {
type: Object
}
}
});
</script>
34 changes: 34 additions & 0 deletions test/sample/imports/computed-binding.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="computed-binding">
<template>
<span>[[isAFunction(myVars)]]</span>
<span>{{notAFunction(notDefined)}}</span>
</template>
</dom-module>

<script>
Polymer({
is: 'computed-binding',
properties: {
/**
* A super nifty property.
*/
myVars: {
type: String,
value: 'Hello linter!'
}
},
isAFunction: function() {
return '';
},
notAFunction: 3
});
</script>
20 changes: 20 additions & 0 deletions test/sample/imports/dom-module-after-polymer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../../polymer/polymer.html">
<script>
Polymer({
is: 'dom-module-after-polymer'
});
</script>
<dom-module id="dom-module-after-polymer">
<template>
I am an awesome element!
</template>
</dom-module>
23 changes: 23 additions & 0 deletions test/sample/imports/element-not-defined.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../../polymer/polymer.html">
<dom-module id="element-not-defined">
<template>
<who-defined-this>
</who-defined-this>
<not-me>
</not-me>
</template>
<script>
Polymer({
is: 'element-not-defined'
});
</script>
</dom-module>
12 changes: 12 additions & 0 deletions test/sample/imports/external-script-error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../../polymer/polymer.html">
<script src="external-script.js">
</script>
27 changes: 27 additions & 0 deletions test/sample/imports/external-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Polymer({
is: 'observer-not-function-external',
properties: {
/*
* This function's observer is a string. Don't do that!
*/
brokenObserver: {
type: String,
value: 'bikeshed',
observer: '_brokenObserverChanged'
},
/*
* This function's observer doesn't even exist!
*/
brokenObserver2: {
type: String,
value: 'bikeshed',
observer: '_brokenObserver2Changed'
}
},
observers: [
'_computeValue(brokenObserver)'
],
_brokenObserverChanged: 'I am not a function',

_computeValue: 42
})
48 changes: 48 additions & 0 deletions test/sample/imports/implicit-properties.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="implicit-properties">
<template>
<el-one string-prop="{{stringProp}}"></el-one>
<el-two string-prop="{{stringProp}}"></el-two>
<el-two tabindex$="{{tabindex}}"></el-two>
<el-one string-prop="{{stringProp1}}"></el-one>
<el-two num-prop="{{stringProp2}}"></el-two>
</template>
</dom-module>
<script>
Polymer({
is: 'el-one',
properties: {
/**
* A super nifty property.
*/
stringProp: {
type: String
}
}
});
Polymer({
is: 'el-two',
properties: {
/**
* A super nifty property.
*/
stringProp: {
type: String
},
numProp: {
type: Number
}
}
});
Polymer({
is: 'implicit-properties'
});
</script>
18 changes: 18 additions & 0 deletions test/sample/imports/missing-is.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="some-element">
<template>
<div>I am some element</div>
</template>
<script>
Polymer({
});
</script>
</dom-module>
35 changes: 35 additions & 0 deletions test/sample/imports/number-literals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<dom-module id="number-literals">
<template>
<span class$="isAFunction(1, myVars)">[[isAFunction(1, myVars)]]</span>
<span class$="isAFunction(1.5, myVars)">[[isAFunction(1.5, myVars)]]</span>
<span class$="isAFunction(-1, myVars)">[[isAFunction(-1, myVars)]]</span>
<span class$="isAFunction(-1.5, myVars)">[[isAFunction(-1.5, myVars)]]</span>
</template>
</dom-module>

<script>
Polymer({
is: 'number-literals',
properties: {
/**
* A super nifty property.
*/
myVars: {
type: String,
value: 'Hello linter!'
}
},
isAFunction: function() {
return '';
}
});
</script>
41 changes: 41 additions & 0 deletions test/sample/imports/observer-not-function.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script>
(function() {
Polymer({
is: 'observer-not-function',
properties: {
/*
* This function's observer is a string. Don't do that!
*/
brokenObserver: {
type: String,
value: 'bikeshed',
observer: '_brokenObserverChanged'
},
/*
* This function's observer doesn't even exist!
*/
brokenObserver2: {
type: String,
value: 'bikeshed',
observer: '_brokenObserver2Changed'
}
},
observers: [
'_computeValue(brokenObserver)',
'_computeValuez(brokenObserver)'
],
_brokenObserverChanged: 'I am not a function',

_computeValue: 42
})
})();
</script>
Loading