[eslint] require final newline (#32265)

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 :)
This commit is contained in:
Spencer 2019-02-28 18:01:29 -08:00 committed by GitHub
parent 9ca411c09e
commit 369bef316a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
178 changed files with 179 additions and 178 deletions

View file

@ -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
@ -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',

View file

@ -76,4 +76,4 @@ export default {
}
}
}
};
};

View file

@ -54,4 +54,4 @@ export default {
}
}
}
};
};

View file

@ -32,4 +32,4 @@ export default {
max_score: 1.0,
hits: hits
}
};
};

View file

@ -17,4 +17,4 @@
* under the License.
*/
export { queryDsl as default } from './dsl';
export { queryDsl as default } from './dsl';

View file

@ -65,4 +65,4 @@ export default function (api) {
'script': { __scope_link: 'GLOBAL.script' },
}
});
}
}

View file

@ -56,4 +56,4 @@ export function getSpec() {
export function addExtensionSpecFilePath(extensionSpecFilePath) {
extensionSpecFilePaths.push(extensionSpecFilePath);
}
}

View file

@ -40,4 +40,4 @@ export class ConditionalProxy extends SharedComponent {
return false;
}
}
}
}

View file

@ -43,4 +43,4 @@ export class GlobalOnlyComponent extends SharedComponent {
return result;
}
}
}

View file

@ -40,4 +40,4 @@ export class IndexAutocompleteComponent extends ListComponent {
getContextKey() {
return 'indices';
}
}
}

View file

@ -26,4 +26,4 @@ export class TemplateAutocompleteComponent extends ListComponent {
getContextKey() {
return 'template';
}
}
}

View file

@ -40,4 +40,4 @@ export class UsernameAutocompleteComponent extends ListComponent {
getContextKey() {
return 'username';
}
}
}

View file

@ -82,4 +82,4 @@ export function ScriptHighlightRules() {
};
}
oop.inherits(ScriptHighlightRules, TextHighlightRules);
oop.inherits(ScriptHighlightRules, TextHighlightRules);

View file

@ -20,4 +20,4 @@
export const workerModule = {
id: 'sense_editor/mode/worker',
src: require('!!raw-loader!./worker.js')
};
};

View file

@ -17,4 +17,4 @@
* under the License.
*/
export { IndexPatternTable } from './index_pattern_table';
export { IndexPatternTable } from './index_pattern_table';

View file

@ -70,4 +70,4 @@ export function getSettingsComponent(id) {
throw new Error(`Component not found with id ${id}`);
}
return registry[id];
}
}

View file

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

View file

@ -30,4 +30,4 @@ export function registerDefaultComponents() {
tryRegisterSettingsComponent(PAGE_TITLE_COMPONENT, PageTitle);
tryRegisterSettingsComponent(PAGE_SUBTITLE_COMPONENT, PageSubtitle);
tryRegisterSettingsComponent(PAGE_FOOTER_COMPONENT, PageFooter);
}
}

View file

@ -40,4 +40,4 @@ describe('default_component_registry', () => {
expect(getSettingsComponent(PAGE_TITLE_COMPONENT)).toEqual(newComponent);
});
});
});

View file

@ -17,4 +17,4 @@
* under the License.
*/
export { PageFooter } from './page_footer';
export { PageFooter } from './page_footer';

View file

@ -17,4 +17,4 @@
* under the License.
*/
export const PageFooter = () => null;
export const PageFooter = () => null;

View file

@ -25,4 +25,4 @@ describe('PageFooter', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageFooter />)).toMatchSnapshot();
});
});
});

View file

@ -17,4 +17,4 @@
* under the License.
*/
export const PageSubtitle = () => null;
export const PageSubtitle = () => null;

View file

@ -25,4 +25,4 @@ describe('PageSubtitle', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageSubtitle />)).toMatchSnapshot();
});
});
});

View file

@ -17,4 +17,4 @@
* under the License.
*/
export { PageTitle } from './page_title';
export { PageTitle } from './page_title';

View file

@ -34,4 +34,4 @@ export const PageTitle = () => {
</h1>
</EuiText>
);
};
};

View file

@ -25,4 +25,4 @@ describe('PageTitle', () => {
it('should render normally', () => {
expect(shallowWithIntl(<PageTitle />)).toMatchSnapshot();
});
});
});

View file

@ -28,4 +28,4 @@ export default (handleChange) => {
return handleChange({ [name]: value });
}
};
};
};

View file

@ -30,4 +30,4 @@ export default (handleChange) => {
return handleChange({ [name]: value });
}
};
};
};

View file

@ -41,4 +41,4 @@ export function detectIE() {
// other browser
return false;
}
}

View file

@ -158,4 +158,4 @@ SplitByTermsUi.propTypes = {
fields: PropTypes.object
};
export const SplitByTerms = injectI18n(SplitByTermsUi);
export const SplitByTerms = injectI18n(SplitByTermsUi);

View file

@ -17,4 +17,4 @@
* under the License.
*/
import './testbed';
import './testbed';

View file

@ -43,4 +43,4 @@ export default function nearest(dataTuples, targetTuples) {
return [bucket[0], closest[1]];
});
}
}

View file

@ -23,4 +23,4 @@
// Does not resample at all.
export default function none(dataTuples) {
return dataTuples;
}
}

View file

@ -51,4 +51,4 @@ export default function (expr) {
return parseFloat(match[1] || 1) * vals[match[2]];
}
}
}

View file

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

View file

@ -102,4 +102,4 @@ export const fieldMappings = {
FlightTimeHour: {
type: 'keyword'
}
};
};

View file

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

View file

@ -18,4 +18,4 @@
*/
export { GlobalBannerList } from './global_banner_list';
export { banners } from './banners';
export { banners } from './banners';

View file

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

View file

@ -120,4 +120,4 @@ export const createZoomWarningMsg = (function () {
}
};
};
}());
}());

View file

@ -17,4 +17,4 @@
* under the License.
*/
export { PieChartProvider } from './pie_chart';
export { PieChartProvider } from './pie_chart';

View file

@ -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';

View file

@ -6,4 +6,4 @@
export { ROUTES } from './routes';
export { PLUGIN } from './plugin';
export { EDITOR } from './editor';
export { EDITOR } from './editor';

View file

@ -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';

View file

@ -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';

View file

@ -34,4 +34,4 @@ export class LearnMoreLinkUi extends React.PureComponent {
}
}
export const LearnMoreLink = injectI18n(LearnMoreLinkUi);
export const LearnMoreLink = injectI18n(LearnMoreLinkUi);

View file

@ -15,4 +15,4 @@ export const PhaseErrorMessage = ({ isShowingErrors }) => {
/>
</EuiBadge>
) : null;
};
};

View file

@ -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';

View file

@ -67,4 +67,4 @@ export const SetPriorityInput = props => {
</ErrableFormRow>
</EuiDescribedFormGroup>
);
};
};

View file

@ -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';

View file

@ -5,4 +5,4 @@
*/
export { filterItems } from './filter_items';
export { sortTable } from './sort_table';
export { sortTable } from './sort_table';

View file

@ -20,4 +20,4 @@ export const goToPolicyList = () => {
export const getPolicyPath = (policyName) => {
return encodeURI(`#${BASE_PATH}policies/edit/${encodeURIComponent(policyName)}`);
};
};

View file

@ -27,4 +27,4 @@ export const defaultColdPhase = {
export const defaultEmptyColdPhase = {
...defaultColdPhase,
[PHASE_INDEX_PRIORITY]: ''
};
};

View file

@ -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;

View file

@ -32,4 +32,4 @@ export const defaultEmptyHotPhase = {
[PHASE_ROLLOVER_MAX_SIZE_STORED]: '',
[PHASE_INDEX_PRIORITY]: '',
[PHASE_ROLLOVER_MAX_DOCUMENTS]: ''
};
};

View file

@ -7,4 +7,4 @@
export * from './delete_phase';
export * from './cold_phase';
export * from './hot_phase';
export * from './warm_phase';
export * from './warm_phase';

View file

@ -36,4 +36,4 @@ export const defaultEmptyWarmPhase = {
...defaultWarmPhase,
[WARM_PHASE_ON_ROLLOVER]: false,
[PHASE_INDEX_PRIORITY]: ''
};
};

View file

@ -14,4 +14,4 @@ import Boom from 'boom';
*/
export function wrapUnknownError(err) {
return Boom.boomify(err);
}
}

View file

@ -30,4 +30,4 @@ describe('flatten_object', () => {
};
expect(flattenObject(obj)).toMatchSnapshot();
});
});
});

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export const settingsDocumentationLink = 'https://stuff.com/docs';
export const settingsDocumentationLink = 'https://stuff.com/docs';

View file

@ -7,4 +7,4 @@
export const toastNotifications = {
addSuccess: () => {},
addDanger: () => {},
};
};

View file

@ -10,4 +10,4 @@ export const addIndexManagementDataEnricher = (enricher) => {
};
export const getIndexManagementDataEnrichers = () => {
return indexManagementDataEnrichers;
};
};

View file

@ -29,4 +29,4 @@ export const settingsToDisplay = [
'index.query.default_field',
'index.refresh_interval',
'index.write.wait_for_active_shards'
];
];

View file

@ -20,4 +20,4 @@ export const flattenObject = (nestedObj, flattenArrays) => {
});
}(nestedObj));
return flatObj;
};
};

View file

@ -44,4 +44,4 @@ export const renderBadges = (index, filterChanged) => {
{badgeLabels}
</Fragment>
);
};
};

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { EditSettingsJson } from './edit_settings_json.container';
export { EditSettingsJson } from './edit_settings_json.container';

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { DetailPanel } from './detail_panel.container';
export { DetailPanel } from './detail_panel.container';

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { ShowJson } from './show_json.container';
export { ShowJson } from './show_json.container';

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { Summary } from './summary.container';
export { Summary } from './summary.container';

View file

@ -126,4 +126,4 @@ export async function loadIndexData(type, indexName) {
case 'Stats':
return loadIndexStats(indexName);
}
}
}

View file

@ -25,4 +25,4 @@ export const showSystemIndicesChanged =
createAction('INDEX_MANAGEMENT_SHOW_SYSTEM_INDICES_CHANGED');
export const toggleChanged =
createAction('INDEX_MANAGEMENT_TOGGLE_CHANGED');
createAction('INDEX_MANAGEMENT_TOGGLE_CHANGED');

View file

@ -59,4 +59,4 @@ export const detailPanel = handleActions(
},
},
defaultState
);
);

View file

@ -15,4 +15,4 @@ export const indexManagement = combineReducers({
rowStatus,
tableState,
detailPanel
});
});

View file

@ -17,4 +17,4 @@ const handler = async (request, callWithRequest, h) => {
};
export function registerFlushRoute(router) {
router.post('indices/flush', handler);
}
}

View file

@ -20,4 +20,4 @@ const handler = async (request, callWithRequest, h) => {
};
export function registerForcemergeRoute(router) {
router.post('indices/forcemerge', handler);
}
}

View file

@ -10,4 +10,4 @@ const handler = async (request, callWithRequest) => {
};
export function registerListRoute(router) {
router.get('indices', handler);
}
}

View file

@ -17,4 +17,4 @@ const handler = async (request, callWithRequest, h) => {
};
export function registerRefreshRoute(router) {
router.post('indices/refresh', handler);
}
}

View file

@ -17,4 +17,4 @@ const handler = async (request, callWithRequest, h) => {
};
export function registerUnfreezeRoute(router) {
router.post('indices/unfreeze', handler);
}
}

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { registerMappingRoute } from './register_mapping_route';
export { registerMappingRoute } from './register_mapping_route';

View file

@ -19,4 +19,4 @@ const handler = async (request, callWithRequest) => {
};
export function registerUpdateRoute(router) {
router.put('settings/{indexName}', handler);
}
}

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { registerStatsRoute } from './register_stats_route';
export { registerStatsRoute } from './register_stats_route';

View file

@ -27,4 +27,4 @@ const handler = async (request, callWithRequest) => {
};
export function registerStatsRoute(router) {
router.get('stats/{indexName}', handler);
}
}

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export * from './upload_license';
export * from './upload_license';

View file

@ -20,4 +20,4 @@ describe('TelemetryOptIn', () => {
const rendered = mountWithIntl(<TelemetryOptIn />);
expect(rendered).toMatchSnapshot();
});
});
});

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export * from './util';
export * from './util';

View file

@ -17,4 +17,4 @@ export default () => (
<Route path={`${BASE_PATH}`} component={LicenseDashboard} />
</Switch>
</EuiPageBody>
);
);

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { TelemetryOptIn } from './telemetry_opt_in';
export { TelemetryOptIn } from './telemetry_opt_in';

View file

@ -5,4 +5,4 @@
*/
import './management_section';
import './register_route';
import './register_route';

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { StartTrial } from './start_trial.container';
export { StartTrial } from './start_trial.container';

View file

@ -14,4 +14,4 @@ export const trialStatus = handleActions({
canStartTrial: payload
};
},
}, {});
}, {});

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { updateLogstashSections } from './update_logstash_sections';
export { updateLogstashSections } from './update_logstash_sections';

View file

@ -88,4 +88,4 @@ describe('fetch_all_from_scroll', () => {
});
});
});
});
});

View file

@ -4,4 +4,4 @@
* you may not use this file except in compliance with the Elastic License.
*/
export { registerLogstashPipelinesRoutes } from './register_pipelines_routes';
export { registerLogstashPipelinesRoutes } from './register_pipelines_routes';

View file

@ -25,4 +25,4 @@ export function StyleTab(props) {
>{ name }
</EuiTab>
) || null;
}
}

View file

@ -101,4 +101,4 @@ routes
})
.otherwise({
redirectTo: '/'
});
});

View file

@ -20,4 +20,4 @@ export function getRGBColorRangeStrings(colorName, numberColors) {
export function getHexColorRangeStrings(colorName, numberColors) {
return getRGBColorRangeStrings(colorName, numberColors)
.map(rgbColor => chroma(rgbColor).hex());
}
}

View file

@ -85,4 +85,4 @@ describe('buildMapsTelemetry', () => {
'mapsTotalCount': 3
});
});
});
});

View file

@ -54,4 +54,4 @@ export function registerMapsUsageCollector(server) {
const mapsUsageCollector = server.usage.collectorSet
.makeUsageCollector(collectorObj);
server.usage.collectorSet.register(mapsUsageCollector);
}
}

View file

@ -66,4 +66,4 @@ describe('buildCollectorObj#fetch', () => {
await expect(fetch()).rejects.toMatchObject(new Error('Sad violin'));
});
});
});
});

Some files were not shown because too many files have changed in this diff Show more