Skip to content

Commit

Permalink
Remove JSX/React eslint plugins.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lbennett-stacki committed Nov 29, 2016
1 parent 35e6c2b commit c145413
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 36 deletions.
1 change: 1 addition & 0 deletions .eslintignore
@@ -1,3 +1,4 @@
/coverage/
/coverage-javascript/
/public/
/tmp/
Expand Down
7 changes: 3 additions & 4 deletions .eslintrc
@@ -1,15 +1,14 @@
{
"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"
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/labels_select.js
@@ -1,4 +1,4 @@
/* 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() {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/notes.js
@@ -1,4 +1,4 @@
/* 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 */
Expand Down
5 changes: 5 additions & 0 deletions changelogs/unreleased/remove-jsx-react-eslint-plugins.yml
@@ -0,0 +1,5 @@
---
title: Changed eslint airbnb config to the base airbnb config and corrected eslintrc
plugins and envs
merge_request: 7470
author: Luke "Jared" Bennett
10 changes: 4 additions & 6 deletions package.json
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion spec/javascripts/build_spec.js.es6
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions spec/javascripts/environments/environment_actions_spec.js.es6
Expand Up @@ -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);
});
});
20 changes: 10 additions & 10 deletions spec/javascripts/environments/environment_item_spec.js.es6
Expand Up @@ -141,40 +141,40 @@ 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);
});
});

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);
});
});

describe('With commit information', () => {
it('should render commit component', () => {
expect(
component.$el.querySelector('.js-commit-component')
component.$el.querySelector('.js-commit-component'),
).toBeDefined();
});
});
Expand All @@ -183,31 +183,31 @@ 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();
});
});

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();
});
});

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();
});
});

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();
});
});
Expand Down
8 changes: 4 additions & 4 deletions spec/javascripts/environments/environments_store_spec.js.es6
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion spec/javascripts/smart_interval_spec.js.es6
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/javascripts/vue_common_components/commit_spec.js.es6
Expand Up @@ -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);
});
});
Expand All @@ -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');
});
});
Expand Down

0 comments on commit c145413

Please sign in to comment.