e87390adb9
* update eslint and dependencies, fix linting errors that can be fixed with --fix * fix lots of linting errors * update eslintrc, fix some linting errors * fix all server side linting errors, untested * fix errors that fixing linting errors had caused * fix client side eslint errors * fix client side linting errors * fix refs lint errors * fix more linting errors * update eslint and dependencies, fix linting errors that can be fixed with --fix * fix lots of linting errors * update eslintrc, fix some linting errors * fix all server side linting errors, untested * fix errors that fixing linting errors had caused * fix client side eslint errors * fix client side linting errors * fix refs lint errors * fix more linting errors * fix some accessibility linting errors * fix a lot of linting errors * fix a billion more linting errors * hopefully fix all linting errors, still need to test * fix bugs that fixing linting had caused
23 lines
648 B
JavaScript
23 lines
648 B
JavaScript
import * as ActionTypes from '../../../constants';
|
|
|
|
const initialState = {
|
|
lintMessages: []
|
|
};
|
|
let messageId = 0;
|
|
|
|
const editorAccessibility = (state = initialState, action) => {
|
|
switch (action.type) {
|
|
case ActionTypes.UPDATE_LINT_MESSAGE:
|
|
messageId += 1;
|
|
return Object.assign({}, state, {
|
|
lintMessages: state.lintMessages.concat(
|
|
{ severity: action.severity, line: action.line, message: action.message, id: messageId })
|
|
});
|
|
case ActionTypes.CLEAR_LINT_MESSAGE:
|
|
return Object.assign({}, state, { lintMessages: [] });
|
|
default:
|
|
return state;
|
|
}
|
|
};
|
|
|
|
export default editorAccessibility;
|