Enable eslint via js-builder

This commit is contained in:
tfennelly 2016-03-07 13:20:43 +00:00
parent cc4d35e581
commit 68f0a21459
7 changed files with 22 additions and 19 deletions

View File

@ -40,6 +40,10 @@ indent_size = 4
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
[**.jsx]
indent_style = space
indent_size = 4
[**.css] [**.css]
indent_style = space indent_style = space
indent_size = 4 indent_size = 4

View File

@ -1,4 +1,4 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
export default class AdminNavLink extends Component { export default class AdminNavLink extends Component {
render() { render() {

View File

@ -2,7 +2,7 @@
"name": "blueocean-core", "name": "blueocean-core",
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"lint": "./node_modules/.bin/eslint .", "lint": "gulp lint",
"lint:fix": "npm run lint -- --fix" "lint:fix": "npm run lint -- --fix"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,4 +1,4 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
export default class AboutNavLink extends Component { export default class AboutNavLink extends Component {
render() { render() {

View File

@ -1,8 +1,7 @@
// Initialise the Blue Ocean app. // Initialise the Blue Ocean app.
var init = require('./init.jsx'); const init = require('./init.jsx');
init.initialize( () => {
init.initialize(() => {
// start the App // start the App
require('./main.jsx'); require('./main.jsx');
}); });

View File

@ -1,15 +1,15 @@
import AboutNavLink from './about/AboutNavLink.jsx'; import AboutNavLink from './about/AboutNavLink.jsx';
exports.initialize = function(oncomplete) { exports.initialize = function (oncomplete) {
// //
// Application initialization. // Application initialization.
// //
var jenkinsMods = require('@jenkins-cd/js-modules'); const jenkinsMods = require('@jenkins-cd/js-modules');
// Create and export the shared js-extensions instance. This // Create and export the shared js-extensions instance. This
// will be accessible to bundles from plugins etc at runtime, allowing them to register // will be accessible to bundles from plugins etc at runtime, allowing them to register
// extension point impls that can be rendered via the ExtensionPoint class. // extension point impls that can be rendered via the ExtensionPoint class.
var extensions = require('@jenkins-cd/js-extensions'); const extensions = require('@jenkins-cd/js-extensions');
jenkinsMods.export('jenkins-cd', 'js-extensions', extensions); jenkinsMods.export('jenkins-cd', 'js-extensions', extensions);
// Create and export a shared instance of the design // Create and export a shared instance of the design
@ -18,19 +18,19 @@ exports.initialize = function(oncomplete) {
jenkinsMods.export('jenkins-cd', 'jdl', jdl); jenkinsMods.export('jenkins-cd', 'jdl', jdl);
// Load and export the react modules, allowing them to be imported by other bundles. // Load and export the react modules, allowing them to be imported by other bundles.
var react = require('react'); const react = require('react');
var reactDOM = require('react-dom'); const reactDOM = require('react-dom');
jenkinsMods.export('react', 'react', react); jenkinsMods.export('react', 'react', react);
jenkinsMods.export('react', 'react-dom', reactDOM); jenkinsMods.export('react', 'react-dom', reactDOM);
// Manually register extention points. TODO: we will be auto-registering these. // Manually register extention points. TODO: we will be auto-registering these.
extensions.store.addExtension("jenkins.topNavigation.menu", AboutNavLink); extensions.store.addExtension('jenkins.topNavigation.menu', AboutNavLink);
// Get the extension list metadata from Jenkins. // Get the extension list metadata from Jenkins.
// Might want to do some flux fancy-pants stuff for this. // Might want to do some flux fancy-pants stuff for this.
var $ = require('jquery-detached').getJQuery(); const $ = require('jquery-detached').getJQuery();
var jenkinsRoot = jenkinsMods.getRootURL(); const jenkinsRoot = jenkinsMods.getRootURL();
$.getJSON(jenkinsRoot + '/blue/javaScriptExtensionInfo', function(data) { $.getJSON(`${jenkinsRoot}/blue/javaScriptExtensionInfo`, (data) => {
extensions.store.setExtensionPointMetadata(data); extensions.store.setExtensionPointMetadata(data);
oncomplete(); oncomplete();
}); });

View File

@ -1,7 +1,7 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {render} from 'react-dom'; import { render } from 'react-dom';
import {ExtensionPoint} from '@jenkins-cd/js-extensions'; import { ExtensionPoint } from '@jenkins-cd/js-extensions';
/** /**
* Root Blue Ocean UI component * Root Blue Ocean UI component
@ -22,7 +22,7 @@ class App extends Component {
This is a label warning styled using the Jenkins Design Language (using CSS class <span className="label-info">label-warning</span>) This is a label warning styled using the Jenkins Design Language (using CSS class <span className="label-info">label-warning</span>)
</div> </div>
<ExtensionPoint name="jenkins.main.body"/> <ExtensionPoint name="jenkins.main.body" />
</main> </main>
<footer> <footer>
<p>This is a footer. I'm sure you'll agree.</p> <p>This is a footer. I'm sure you'll agree.</p>