Commit c145413d authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Remove JSX/React eslint plugins.

Change airbnb eslint config package to `eslint-config-airbnb-base` and update plugins.

Change `airbnb` to `airbnb-base` for .eslintrc `extends` value.

Added changelog entry

Made sure all plugins and envs are set

Corrected new failing specs
parent 35e6c2ba
/coverage/
/coverage-javascript/
/public/
/tmp/
......
{
"env": {
"jquery": true,
"browser": true,
"es6": true
},
"extends": "airbnb",
"extends": "airbnb-base",
"globals": {
"$": false,
"_": false,
"gl": false,
"gon": false,
"jQuery": false
"gon": false
},
"plugins": [
"filenames"
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return, no-undef, semi, dot-notation, no-empty, no-return-assign, camelcase, prefer-spread, padded-blocks, max-len */
/* eslint-disable no-useless-return, func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return, no-undef, semi, dot-notation, no-empty, no-return-assign, camelcase, prefer-spread, padded-blocks, max-len */
(function() {
this.LabelsSelect = (function() {
function LabelsSelect() {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, no-undef, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, semi, indent, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix, padded-blocks, max-len */
/* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, no-undef, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, semi, indent, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix, padded-blocks, max-len */
/*= require autosave */
/*= require autosize */
......
---
title: Changed eslint airbnb config to the base airbnb config and corrected eslintrc
plugins and envs
merge_request: 7470
author: Luke "Jared" Bennett
......@@ -6,13 +6,11 @@
"eslint-report": "npm run eslint -- --format html --output-file ./eslint-report.html"
},
"devDependencies": {
"eslint": "^3.1.1",
"eslint-config-airbnb": "^12.0.0",
"eslint": "^3.10.1",
"eslint-config-airbnb-base": "^10.0.1",
"eslint-plugin-filenames": "^1.1.0",
"eslint-plugin-import": "^1.16.0",
"eslint-plugin-jasmine": "^1.8.1",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.4.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jasmine": "^2.1.0",
"istanbul": "^0.4.5"
}
}
......@@ -109,7 +109,7 @@ describe('Build', () => {
expect($.ajax.calls.count()).toBe(2);
let [{ url, dataType, success, context }] = $.ajax.calls.argsFor(1);
expect(url).toBe(
`${BUILD_URL}/trace.json?state=${encodeURIComponent(INITIAL_BUILD_TRACE_STATE)}`
`${BUILD_URL}/trace.json?state=${encodeURIComponent(INITIAL_BUILD_TRACE_STATE)}`,
);
expect(dataType).toBe('json');
expect(success).toEqual(jasmine.any(Function));
......
......@@ -28,10 +28,10 @@ describe('Actions Component', () => {
});
expect(
component.$el.querySelectorAll('.dropdown-menu li').length
component.$el.querySelectorAll('.dropdown-menu li').length,
).toEqual(actionsMock.length);
expect(
component.$el.querySelector('.dropdown-menu li a').getAttribute('href')
component.$el.querySelector('.dropdown-menu li a').getAttribute('href'),
).toEqual(actionsMock[0].play_path);
});
});
......@@ -141,18 +141,18 @@ describe('Environment item', () => {
describe('With deployment', () => {
it('should render deployment internal id', () => {
expect(
component.$el.querySelector('.deployment-column span').textContent
component.$el.querySelector('.deployment-column span').textContent,
).toContain(environment.last_deployment.iid);
expect(
component.$el.querySelector('.deployment-column span').textContent
component.$el.querySelector('.deployment-column span').textContent,
).toContain('#');
});
describe('With user information', () => {
it('should render user avatar with link to profile', () => {
expect(
component.$el.querySelector('.js-deploy-user-container').getAttribute('href')
component.$el.querySelector('.js-deploy-user-container').getAttribute('href'),
).toEqual(environment.last_deployment.user.web_url);
});
});
......@@ -160,13 +160,13 @@ describe('Environment item', () => {
describe('With build url', () => {
it('Should link to build url provided', () => {
expect(
component.$el.querySelector('.build-link').getAttribute('href')
component.$el.querySelector('.build-link').getAttribute('href'),
).toEqual(environment.last_deployment.deployable.build_path);
});
it('Should render deployable name and id', () => {
expect(
component.$el.querySelector('.build-link').getAttribute('href')
component.$el.querySelector('.build-link').getAttribute('href'),
).toEqual(environment.last_deployment.deployable.build_path);
});
});
......@@ -174,7 +174,7 @@ describe('Environment item', () => {
describe('With commit information', () => {
it('should render commit component', () => {
expect(
component.$el.querySelector('.js-commit-component')
component.$el.querySelector('.js-commit-component'),
).toBeDefined();
});
});
......@@ -183,7 +183,7 @@ describe('Environment item', () => {
describe('With manual actions', () => {
it('Should render actions component', () => {
expect(
component.$el.querySelector('.js-manual-actions-container')
component.$el.querySelector('.js-manual-actions-container'),
).toBeDefined();
});
});
......@@ -191,7 +191,7 @@ describe('Environment item', () => {
describe('With external URL', () => {
it('should render external url component', () => {
expect(
component.$el.querySelector('.js-external-url-container')
component.$el.querySelector('.js-external-url-container'),
).toBeDefined();
});
});
......@@ -199,7 +199,7 @@ describe('Environment item', () => {
describe('With stop action', () => {
it('Should render stop action component', () => {
expect(
component.$el.querySelector('.js-stop-component-container')
component.$el.querySelector('.js-stop-component-container'),
).toBeDefined();
});
});
......@@ -207,7 +207,7 @@ describe('Environment item', () => {
describe('With retry action', () => {
it('Should render rollback component', () => {
expect(
component.$el.querySelector('.js-rollback-component-container')
component.$el.querySelector('.js-rollback-component-container'),
).toBeDefined();
});
});
......
......@@ -5,11 +5,11 @@
//= require ./mock_data
(() => {
beforeEach(() => {
gl.environmentsList.EnvironmentsStore.create();
});
describe('Store', () => {
beforeEach(() => {
gl.environmentsList.EnvironmentsStore.create();
});
it('should start with a blank state', () => {
expect(gl.environmentsList.EnvironmentsStore.state.environments.length).toBe(0);
expect(gl.environmentsList.EnvironmentsStore.state.stoppedCounter).toBe(0);
......
......@@ -37,7 +37,7 @@
const intervalConfig = this.smartInterval.cfg;
const iterationCount = 4;
const maxIntervalAfterIterations = intervalConfig.startingInterval *
Math.pow(intervalConfig.incrementByFactorOf, (iterationCount - 1)); // 40
(intervalConfig.incrementByFactorOf ** (iterationCount - 1)); // 40
const currentInterval = interval.getCurrentInterval();
// Provide some flexibility for performance of testing environment
......
......@@ -74,26 +74,26 @@ describe('Commit component', () => {
describe('Given commit title and author props', () => {
it('Should render a link to the author profile', () => {
expect(
component.$el.querySelector('.commit-title .avatar-image-container').getAttribute('href')
component.$el.querySelector('.commit-title .avatar-image-container').getAttribute('href'),
).toEqual(props.author.web_url);
});
it('Should render the author avatar with title and alt attributes', () => {
expect(
component.$el.querySelector('.commit-title .avatar-image-container img').getAttribute('title')
component.$el.querySelector('.commit-title .avatar-image-container img').getAttribute('title'),
).toContain(props.author.username);
expect(
component.$el.querySelector('.commit-title .avatar-image-container img').getAttribute('alt')
component.$el.querySelector('.commit-title .avatar-image-container img').getAttribute('alt'),
).toContain(`${props.author.username}'s avatar`);
});
});
it('should render the commit title', () => {
expect(
component.$el.querySelector('a.commit-row-message').getAttribute('href')
component.$el.querySelector('a.commit-row-message').getAttribute('href'),
).toEqual(props.commit_url);
expect(
component.$el.querySelector('a.commit-row-message').textContent
component.$el.querySelector('a.commit-row-message').textContent,
).toContain(props.title);
});
});
......@@ -119,7 +119,7 @@ describe('Commit component', () => {
});
expect(
component.$el.querySelector('.commit-title span').textContent
component.$el.querySelector('.commit-title span').textContent,
).toContain('Cant find HEAD commit for this branch');
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment