Skip to content

Commit

Permalink
[eslint] require final newline (#32265)
Browse files Browse the repository at this point in the history
We have had `insert_final_newline = true` in our `.editorconfig` file since April 2015, but never validated it with eslint. I'm a little tired of extra changes showing up in PRs because some people use editors which respect the `.editorconfig` file and some don't, so I figured we might want to enable the rule in eslint so that the can be autofixed.

Votes requested please :)
  • Loading branch information
Spencer authored Mar 1, 2019
1 parent 9ca411c commit 369bef3
Show file tree
Hide file tree
Showing 178 changed files with 179 additions and 178 deletions.
3 changes: 2 additions & 1 deletion packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module.exports = {
strict: [ 'error', 'never' ],
'valid-typeof': 'error',
'wrap-iife': [ 'error', 'outside' ],
'eol-last': ['error', 'always'],
yoda: 'off',

'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing
Expand Down Expand Up @@ -150,7 +151,7 @@ module.exports = {
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-will-update-set-state': 'error',
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/field_mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ export default {
}
}
}
};
};
2 changes: 1 addition & 1 deletion src/fixtures/mapping_with_dupes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ export default {
}
}
}
};
};
2 changes: 1 addition & 1 deletion src/fixtures/search_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export default {
max_score: 1.0,
hits: hits
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { queryDsl as default } from './dsl';
export { queryDsl as default } from './dsl';
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ export default function (api) {
'script': { __scope_link: 'GLOBAL.script' },
}
});
}
}
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/console/api_server/spec/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ export function getSpec() {

export function addExtensionSpecFilePath(extensionSpecFilePath) {
extensionSpecFilePaths.push(extensionSpecFilePath);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export class ConditionalProxy extends SharedComponent {
return false;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ export class GlobalOnlyComponent extends SharedComponent {
return result;

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export class IndexAutocompleteComponent extends ListComponent {
getContextKey() {
return 'indices';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export class TemplateAutocompleteComponent extends ListComponent {
getContextKey() {
return 'template';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export class UsernameAutocompleteComponent extends ListComponent {
getContextKey() {
return 'username';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ export function ScriptHighlightRules() {
};
}

oop.inherits(ScriptHighlightRules, TextHighlightRules);
oop.inherits(ScriptHighlightRules, TextHighlightRules);
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
export const workerModule = {
id: 'sense_editor/mode/worker',
src: require('!!raw-loader!./worker.js')
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { IndexPatternTable } from './index_pattern_table';
export { IndexPatternTable } from './index_pattern_table';
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ export function getSettingsComponent(id) {
throw new Error(`Component not found with id ${id}`);
}
return registry[id];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ describe('getSettingsComponent', () => {
it('should throw an error when requesting a component that does not exist', () => {
expect(() => getSettingsComponent('does not exist')).toThrowErrorMatchingSnapshot();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export function registerDefaultComponents() {
tryRegisterSettingsComponent(PAGE_TITLE_COMPONENT, PageTitle);
tryRegisterSettingsComponent(PAGE_SUBTITLE_COMPONENT, PageSubtitle);
tryRegisterSettingsComponent(PAGE_FOOTER_COMPONENT, PageFooter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ describe('default_component_registry', () => {

expect(getSettingsComponent(PAGE_TITLE_COMPONENT)).toEqual(newComponent);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { PageFooter } from './page_footer';
export { PageFooter } from './page_footer';
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export const PageFooter = () => null;
export const PageFooter = () => null;
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe('PageFooter', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageFooter />)).toMatchSnapshot();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export const PageSubtitle = () => null;
export const PageSubtitle = () => null;
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe('PageSubtitle', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageSubtitle />)).toMatchSnapshot();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { PageTitle } from './page_title';
export { PageTitle } from './page_title';
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export const PageTitle = () => {
</h1>
</EuiText>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe('PageTitle', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageTitle />)).toMatchSnapshot();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export default (handleChange) => {
return handleChange({ [name]: value });
}
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export default (handleChange) => {
return handleChange({ [name]: value });
}
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ export function detectIE() {

// other browser
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ SplitByTermsUi.propTypes = {
fields: PropTypes.object
};

export const SplitByTerms = injectI18n(SplitByTermsUi);
export const SplitByTerms = injectI18n(SplitByTermsUi);
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/testbed/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

import './testbed';
import './testbed';
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ export default function nearest(dataTuples, targetTuples) {

return [bucket[0], closest[1]];
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
// Does not resample at all.
export default function none(dataTuples) {
return dataTuples;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ export default function (expr) {

return parseFloat(match[1] || 1) * vals[match[2]];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
test('test', () => {
// errors module is tested in test/api_integration/apis/index_patterns/es_errors/errors.js
// so it can get real errors from elasticsearch and the es client to test with
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ export const fieldMappings = {
FlightTimeHour: {
type: 'keyword'
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ test('should include sampleDataSetId and dataIndexId in elasticsearch index name

test('should only include sampleDataSetId when sampleDataSetId and dataIndexId are identical', async () => {
expect(createIndexName('flights', 'flights')).toBe('kibana_sample_data_flights');
});
});
2 changes: 1 addition & 1 deletion src/legacy/ui/public/notify/banners/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
*/

export { GlobalBannerList } from './global_banner_list';
export { banners } from './banners';
export { banners } from './banners';
2 changes: 1 addition & 1 deletion src/legacy/ui/public/persisted_log/create_log_key.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ describe('createLogKey', () => {
it('should not include a hashed suffix if the identifier is not present', () => {
expect(createLogKey('foo')).toEqual('kibana.history.foo');
});
});
});
2 changes: 1 addition & 1 deletion src/legacy/ui/public/vis/map/map_messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ export const createZoomWarningMsg = (function () {
}
};
};
}());
}());
2 changes: 1 addition & 1 deletion test/functional/services/visualizations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { PieChartProvider } from './pie_chart';
export { PieChartProvider } from './pie_chart';
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { licensePreRoutingFactory } from './license_pre_routing_factory';
export { licensePreRoutingFactory } from './license_pre_routing_factory';
2 changes: 1 addition & 1 deletion x-pack/plugins/grokdebugger/common/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

export { ROUTES } from './routes';
export { PLUGIN } from './plugin';
export { EDITOR } from './editor';
export { EDITOR } from './editor';
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { checkLicense } from './check_license';
export { checkLicense } from './check_license';
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
export { ActiveBadge } from './active_badge';
export { LearnMoreLink } from './learn_more_link';
export { PhaseErrorMessage } from './phase_error_message';
export { OptionalLabel } from './optional_label';
export { OptionalLabel } from './optional_label';
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export class LearnMoreLinkUi extends React.PureComponent {

}
}
export const LearnMoreLink = injectI18n(LearnMoreLinkUi);
export const LearnMoreLink = injectI18n(LearnMoreLinkUi);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export const PhaseErrorMessage = ({ isShowingErrors }) => {
/>
</EuiBadge>
) : null;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { NodeAllocation } from './node_allocation.container';
export { NodeAllocation } from './node_allocation.container';
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ export const SetPriorityInput = props => {
</ErrableFormRow>
</EuiDescribedFormGroup>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/

export { PolicyTable } from './policy_table.container';
export { PolicyTable } from './policy_table.container';
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*/

export { filterItems } from './filter_items';
export { sortTable } from './sort_table';
export { sortTable } from './sort_table';
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export const goToPolicyList = () => {

export const getPolicyPath = (policyName) => {
return encodeURI(`#${BASE_PATH}policies/edit/${encodeURIComponent(policyName)}`);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export const defaultColdPhase = {
export const defaultEmptyColdPhase = {
...defaultColdPhase,
[PHASE_INDEX_PRIORITY]: ''
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export const defaultDeletePhase = {
[PHASE_ROLLOVER_MINIMUM_AGE]: '',
[PHASE_ROLLOVER_MINIMUM_AGE_UNITS]: 'd'
};
export const defaultEmptyDeletePhase = defaultDeletePhase;
export const defaultEmptyDeletePhase = defaultDeletePhase;
Loading

0 comments on commit 369bef3

Please sign in to comment.