Skip to content

Commit

Permalink
Merge pull request #5202 from Polymer/3.x-linter-warnings
Browse files Browse the repository at this point in the history
Fix ESLint gulp task for 3.x
  • Loading branch information
kevinpschaaf authored May 1, 2018
2 parents da2d66d + 0bb5d7c commit b3d52a7
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 62 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-console": "off",
Expand Down
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
language: node_js
sudo: false
dist: trusty
node_js: stable
node_js: '9'
addons:
firefox: latest
chrome: stable
cache:
directories:
- node_modules
before_script:
- npm install -g bower gulp-cli@1
- bower install
- npm install -g gulp-cli@1
- gulp lint-eslint
- >-
npm run update-types && git diff --exit-code || (echo -e
'\n\033[31mERROR:\033[0m Typings are stale. Please run "npm run
update-types".' && false)
# TODO(dfreedm): re-enable after making update-types work
#- >-
# npm run update-types && git diff --exit-code || (echo -e
# '\n\033[31mERROR:\033[0m Typings are stale. Please run "npm run
# update-types".' && false)
script:
- wct -l chrome -l firefox
- wct --npm --module-resolution=node -l chrome -l firefox
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then travis_wait 30 ./util/travis-sauce-test.sh; fi
env:
global:
Expand Down
36 changes: 0 additions & 36 deletions bower.json

This file was deleted.

14 changes: 7 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ gulp.task('closure', ['generate-externs'], () => {
addClosureTypes = new AddClosureTypeImport(entry, 'externs/polymer-internal-types.html');
}

config('polymer.html');
config('polymer-legacy.js');

const project = new PolymerProject({
shell: `./${entry}`,
fragments: [
'bower_components/shadycss/apply-shim.html',
'bower_components/shadycss/custom-style-interface.html'
'node_modules/@webcomponents/shadycss/entrypoints/apply-shim.js',
'node_modules/@webcomponents/shadycss/entrypoints/custom-style-interface.js'
],
extraDependencies: [
addClosureTypes.importPath,
Expand Down Expand Up @@ -219,8 +219,8 @@ gulp.task('estimate-size', ['clean'], () => {
const project = new PolymerProject({
shell: POLYMER_LEGACY,
fragments: [
'bower_components/shadycss/apply-shim.html',
'bower_components/shadycss/custom-style-interface.html'
'node_modules/@webcomponents/shadycss/entrypoints/apply-shim.js',
'node_modules/@webcomponents/shadycss/entrypoints/custom-style-interface.js'
]
});

Expand Down Expand Up @@ -250,7 +250,7 @@ gulp.task('estimate-size', ['clean'], () => {
});

gulp.task('lint-eslint', function() {
return gulp.src(['lib/**/*.html', 'test/unit/*.html', 'util/*.js'])
return gulp.src(['lib/**/*.js', 'test/unit/*.{html,js}', 'util/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
Expand Down Expand Up @@ -281,7 +281,7 @@ gulp.task('generate-typescript', async () => {
});

gulp.task('update-version', () => {
return gulp.src('lib/utils/boot.html')
return gulp.src('lib/utils/boot.js')
.pipe(replace(/(window.Polymer.version = )'\d+\.\d+\.\d+'/, `$1'${require('./package.json').version}'`))
.pipe(gulp.dest('lib/utils'));
});
2 changes: 1 addition & 1 deletion lib/utils/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ 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
*/

window.JSCompiler_renameProperty = function(prop, obj) { return prop; }
window.JSCompiler_renameProperty = function(prop) { return prop; };
2 changes: 1 addition & 1 deletion lib/utils/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ export const Debouncer = class Debouncer {
debouncer.setConfig(asyncModule, callback);
return debouncer;
}
}
};
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@polymer/iron-component-page": "3.0.0-pre.12",
"@polymer/test-fixture": "3.0.0-pre.12",
"@webcomponents/webcomponentsjs": "^2.0.0-0",
"babel-eslint": "^7.2.3",
"babel-preset-minify": "^0.2.0",
"del": "^3.0.0",
"dom5": "^3.0.0",
Expand Down
8 changes: 6 additions & 2 deletions test/unit/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<script type="module">
import './dom-bind-elements1.js';
import './dom-bind-elements2.js';
/* global earlyDomBind earlyBoundChild declaredXBasic1 declaredXBasic2 declarativeDomBind boundTextDiv container needsHost nonUpgrade*/
/* global earlyDomBind */
earlyDomBind.value = 'hi!';
</script>

Expand Down Expand Up @@ -77,6 +77,7 @@

suite('dom-bind touched before upgrade', function() {
test('value binds top-down', function() {
/* global earlyBoundChild*/
assert.equal(earlyBoundChild.textContent, 'hi!');
});
});
Expand All @@ -88,6 +89,7 @@
var el2;

setup(function() {
/* global declarativeDomBind declaredXBasic1 declaredXBasic2 */
domBind = declarativeDomBind;
el1 = declaredXBasic1;
el2 = declaredXBasic2;
Expand Down Expand Up @@ -127,6 +129,7 @@

test('initial value notifies to dom-bind', function() {
assert.equal(domBind.boundText, 'this text is bound');
/* global boundTextDiv */
assert.equal(boundTextDiv.textContent, 'this text is bound');
});

Expand Down Expand Up @@ -206,6 +209,7 @@
});

test('move dom-bind', function( ) {
/* global container */
container.appendChild(domBind);

assert.equal(container.firstElementChild, el1);
Expand Down Expand Up @@ -260,7 +264,7 @@
});

});

/* global needsHost nonUpgrade */
suite('timing', function() {

test('late-loaded import should block stamping', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<script src="../../node_modules/wct-browser-legacy/browser.js"></script>
<script src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script type="module">
/* global origOwnProps:true */
window.origOwnProps = Object.getOwnPropertyNames(window).reduce(function(props, prop) {
return props[prop] = true && props;
}, {});
Expand Down Expand Up @@ -62,8 +61,9 @@
<global-test></global-test>

<script type="module">
import { Polymer } from '../../polymer-legacy.js';
import '../../polymer-legacy.js';

/* global origOwnProps */
suite('globals', function() {

var expected = {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/wct-browser-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ window.WCT = {
'accessibility-developer-tools/dist/js/axs_testing.js',
'@polymer/test-fixture/test-fixture.js'
]
}
};
2 changes: 0 additions & 2 deletions util/minimalDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

'use strict';

const dom5 = require('dom5');
const parse5 = require('parse5');
const {Transform} = require('stream');
Expand Down
2 changes: 1 addition & 1 deletion util/travis-sauce-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
#
set -x
wct -s 'windows 10/microsoftedge@14' -s 'windows 10/microsoftedge@15' -s 'windows 10/microsoftedge@16' -s 'windows 8.1/internet explorer@11' -s 'os x 10.11/safari@9' -s 'macos 10.12/safari@10' -s 'macos 10.13/safari@11' -s 'Linux/chrome@41'
wct --npm --module-resolution=node -s 'windows 10/microsoftedge@14' -s 'windows 10/microsoftedge@15' -s 'windows 10/microsoftedge@16' -s 'windows 8.1/internet explorer@11' -s 'os x 10.11/safari@9' -s 'macos 10.12/safari@10' -s 'macos 10.13/safari@11' -s 'Linux/chrome@41'

0 comments on commit b3d52a7

Please sign in to comment.