Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eslintify panel #35

Merged
merged 7 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/component-utils/proxy-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ProxyComponent extends Component {
* }
* }
*/
allowEvent(ev) {
allowEvent(ev) { // eslint-disable-line no-unused-vars
return true;
}

Expand Down
3 changes: 1 addition & 2 deletions lib/component.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import cuid from 'cuid';
import pick from 'lodash.pick';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! dead weight

import WebComponent from 'webcomponent';

import {EMPTY_DIV, DOMPatcher, h} from './dom-patcher';
Expand Down Expand Up @@ -166,7 +165,7 @@ class Component extends WebComponent {
* return state.largeResultSetID !== this._cachedResultID;
* }
*/
shouldUpdate(state) {
shouldUpdate(state) { // eslint-disable-line no-unused-vars
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/dom-patcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export class DOMPatcher {
this.vnode = this.renderFunc(this.state);

// prepare root element
const tagName = this.vnode.sel.split(/[#\.]/)[0];
const classMatches = this.vnode.sel.match(/\.[^\.#]+/g);
const idMatch = this.vnode.sel.match(/#[^\.#]+/);
const tagName = this.vnode.sel.split(/[#.]/)[0];
const classMatches = this.vnode.sel.match(/\.[^.#]+/g);
const idMatch = this.vnode.sel.match(/#[^.#]+/);
this.el = document.createElement(tagName);
if (classMatches) {
this.el.className = classMatches.map(c => c.slice(1)).join(` `);
Expand Down
1 change: 1 addition & 0 deletions lib/isorender/dom-shims.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global global */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be eslint-env node?

/**
* Node.js polyfill for rendering Panel components without a browser.
* Makes the following objects globally available:
Expand Down
10 changes: 5 additions & 5 deletions lib/router.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function stripHash(fragment) {
return fragment.replace(/^#*/, ``);
}

// just the necessary bits of Backbone router+history
export default class Router {
constructor(app, options={}) {
Expand All @@ -13,7 +17,7 @@ export default class Router {
const optionalParam = /\((.*?)\)/g;
const namedParam = /(\(\?)?:\w+/g;
const splatParam = /\*\w+/g;
const escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
const escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; // eslint-disable-line no-useless-escape
this.compiledRoutes = Object.keys(routeDefs).map(routeExpr => {
// https://github.com/jashkenas/backbone/blob/d682061a/backbone.js#L1537-L1547
let expr = routeExpr
Expand Down Expand Up @@ -89,7 +93,3 @@ export default class Router {
}
}
}

function stripHash(fragment) {
return fragment.replace(/^#*/, ``);
}
1 change: 1 addition & 0 deletions test/fixtures/attr-reflection-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {Component, h} from '../../lib';
export class AttrReflectionApp extends Component {
get config() {
return {
// eslint-disable-next-line no-unused-vars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a test fixture, might as well make it conform with template: () => h(...) (ditto for the other fixtures below)

template: state => h(`div`, {class: {'attr-app': true}}, [
h(`p`, `Value of attribute wombats: ${this.getAttribute(`wombats`)}`),
]),
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/css-no-shadow-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class CssNoShadowApp extends Component {
get config() {
return {
css: `color: blue;`,

// eslint-disable-next-line no-unused-vars
template: state => h(`div`, {class: {foo: true}}, [
h(`p`, `Hello`),
]),
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shadow-dom-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export class ShadowDomApp extends Component {
get config() {
return {
css: `color: blue;`,

// eslint-disable-next-line no-unused-vars
template: state => h(`div`, {class: {foo: true}}, [
h(`p`, `Hello`),
]),
Expand Down
1 change: 1 addition & 0 deletions test/server/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env mocha */
import '../../lib/isorender/dom-shims';

import {expect} from 'chai';
Expand Down
2 changes: 2 additions & 0 deletions test/server/dom-patcher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-env mocha */
/* eslint-disable no-unused-expressions */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the unused expressions it's complaining about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect(domPatcher.el).to.be.ok;

it isn't ok with to.be.ok

import '../../lib/isorender/dom-shims';

import {expect} from 'chai';
Expand Down