Skip to content

Commit 1503d4d

Browse files
author
Catherine Siller
authored
Merge pull request #264 from rackerlabs/rollup-eslint
feat(rollup-plugin-eslint): added eslint plugin with rollup
2 parents 707e297 + 74a2e13 commit 1503d4d

File tree

14 files changed

+35
-21
lines changed

14 files changed

+35
-21
lines changed

lib/compile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ async function compileScripts () {
4545
console.log('SRC: Compiling JavaScript');
4646

4747
// TODO: convert to npm script
48-
await exec(`yarn rollup`, { cwd: CONFIG.root });
48+
await exec(`yarn rollup`, { cwd: CONFIG.root }, function(error, stderr){
49+
if (error) {
50+
console.error(`exec error: ${error}`);
51+
return;
52+
}
53+
console.log(`stderr: ${stderr}`);
54+
});
4955
}//compileScripts()
5056

5157
async function compileAll () {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"rollup": "0.60",
4343
"rollup-plugin-babel": "^3.0.2",
4444
"rollup-plugin-commonjs": "9.x",
45+
"rollup-plugin-eslint": "^4.0.0",
4546
"rollup-plugin-html": "^0.2.1",
4647
"rollup-plugin-json": "3.x",
4748
"rollup-plugin-node-resolve": "^3.0.0",

rollup.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { minify } from 'uglify-es';
77
import less from './lib/rollup-plugin-less';
88
import resolve from 'rollup-plugin-node-resolve';
99
import commonjs from 'rollup-plugin-commonjs';
10+
import eslint from 'rollup-plugin-eslint';
1011

1112
let htmlPlugin = html ({
1213
include: [
@@ -31,6 +32,12 @@ let lessPlugin = less({
3132
}
3233
});
3334

35+
let eslintPlugin = eslint({
36+
include: [
37+
'**/*.js',
38+
],
39+
});
40+
3441
// Intro/Outro placed INSIDE the applied dependency function
3542
let intro = `window.addEventListener('WebComponentsReady', function () {`;
3643
let outro = `});`;
@@ -81,6 +88,7 @@ export default [
8188
commonjs(),
8289
htmlPlugin,
8390
lessPlugin,
91+
eslintPlugin,
8492
babelPlugin,
8593
uglify({}, minify),
8694
],

src/helix-ui/elements/HXAccordionPanelElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import shadowStyles from './HXAccordionPanelElement.less';
2929
*/
3030
export class HXAccordionPanelElement extends HXElement {
3131
static get is () {
32-
return `hx-accordion-panel`;
32+
return 'hx-accordion-panel';
3333
}
3434

3535
static get template () {

src/helix-ui/elements/HXAlertElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ICONS = {
3636
*/
3737
export class HXAlertElement extends HXElement {
3838
static get is () {
39-
return `hx-alert`;
39+
return 'hx-alert';
4040
}
4141

4242
static get template () {

src/helix-ui/elements/HXBusyElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class HXBusyElement extends HXElement {
1313
}
1414

1515
static get template () {
16-
return ``;
16+
return '';
1717
}
1818

1919
connectedCallback () {

src/helix-ui/elements/HXCheckboxElement.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { HXElement } from './HXElement';
2-
import { KEYS } from '../util';
32
import shadowMarkup from './HXCheckboxElement.html';
43
import shadowStyles from './HXCheckboxElement.less';
54

src/helix-ui/elements/HXDisclosureElement.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export class HXDisclosureElement extends HXElement {
1414
}
1515

1616
static get observedAttributes () {
17-
return super.observedAttributes.concat([
18-
'aria-expanded',
19-
]);
17+
return super.observedAttributes.concat([ 'aria-expanded' ]);
2018
}
2119

2220
constructor () {
@@ -61,8 +59,7 @@ export class HXDisclosureElement extends HXElement {
6159
attributeChangedCallback (attr, oldVal, newVal) {
6260
super.attributeChangedCallback(attr, oldVal, newVal);
6361

64-
const hasValue = (newVal !== null);
65-
switch(attr) {
62+
switch (attr) {
6663
case 'aria-expanded':
6764
if (this.target) {
6865
let setTo = (newVal === 'true');

src/helix-ui/elements/HXPillElement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import shadowStyles from './HXPillElement.less';
1919
*/
2020
export class HXPillElement extends HXElement {
2121
static get is () {
22-
return `hx-pill`;
22+
return 'hx-pill';
2323
}
2424

2525
static get template () {

src/helix-ui/elements/HXToastElement.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ export class HXToastElement extends HXElement {
6262
}
6363

6464
static get observedAttributes () {
65-
return [
66-
'cta',
67-
'type',
68-
];
65+
return [ 'cta', 'type' ];
6966
}//observedAttributes
7067

7168
attributeChangedCallback (attr, oldVal, newVal) {

0 commit comments

Comments
 (0)