diff --git a/app/assets/javascripts/components/features/ui/components/column_link.jsx b/app/assets/javascripts/components/features/ui/components/column_link.jsx
index 2bd1e1017..fb253bbbd 100644
--- a/app/assets/javascripts/components/features/ui/components/column_link.jsx
+++ b/app/assets/javascripts/components/features/ui/components/column_link.jsx
@@ -34,7 +34,8 @@ ColumnLink.propTypes = {
icon: React.PropTypes.string.isRequired,
text: React.PropTypes.string.isRequired,
to: React.PropTypes.string,
- href: React.PropTypes.string
+ href: React.PropTypes.string,
+ method: React.PropTypes.string
};
export default ColumnLink;
diff --git a/app/assets/javascripts/components/features/ui/components/media_modal.jsx b/app/assets/javascripts/components/features/ui/components/media_modal.jsx
index 130f48b46..786b08152 100644
--- a/app/assets/javascripts/components/features/ui/components/media_modal.jsx
+++ b/app/assets/javascripts/components/features/ui/components/media_modal.jsx
@@ -104,8 +104,8 @@ const MediaModal = React.createClass({
leftNav = rightNav = content = '';
if (media.size > 1) {
- leftNav =
;
}
if (attachment.get('type') === 'image') {
diff --git a/app/assets/javascripts/components/features/ui/components/modal_root.jsx b/app/assets/javascripts/components/features/ui/components/modal_root.jsx
index 74eb50039..a1ed8fd88 100644
--- a/app/assets/javascripts/components/features/ui/components/modal_root.jsx
+++ b/app/assets/javascripts/components/features/ui/components/modal_root.jsx
@@ -66,7 +66,7 @@ const ModalRoot = React.createClass({
return (
-
+
diff --git a/app/assets/javascripts/components/link_header.jsx b/app/assets/javascripts/components/link_header.jsx
index 9a9ff7e7a..b872dc24a 100644
--- a/app/assets/javascripts/components/link_header.jsx
+++ b/app/assets/javascripts/components/link_header.jsx
@@ -14,7 +14,7 @@ Link.parseAttrs = (link, parts) => {
link = Link.parseParams(link, uriAttrs[1])
}
- while(match = Link.attrPattern.exec(attrs)) {
+ while(match = Link.attrPattern.exec(attrs)) { // eslint-disable-line no-cond-assign
attr = match[1].toLowerCase()
value = match[4] || match[3] || match[2]
diff --git a/app/assets/javascripts/components/locales/es.jsx b/app/assets/javascripts/components/locales/es.jsx
index 7e9c0dc2c..b118def8b 100644
--- a/app/assets/javascripts/components/locales/es.jsx
+++ b/app/assets/javascripts/components/locales/es.jsx
@@ -73,7 +73,7 @@ const es = {
"notifications.column_settings.mention": "Menciones:",
"notifications.column_settings.reblog": "Retoots:",
"emoji_button.label": "Insertar emoji",
- "privacy.public.short": "Público",
+ "privacy.public.short": "Público",
"privacy.public.long": "Mostrar en la historia federada",
"privacy.unlisted.short": "Sin federar",
"privacy.unlisted.long": "No mostrar en la historia federada",
diff --git a/app/assets/javascripts/components/locales/ru.jsx b/app/assets/javascripts/components/locales/ru.jsx
index 95ed52656..5d84527b6 100644
--- a/app/assets/javascripts/components/locales/ru.jsx
+++ b/app/assets/javascripts/components/locales/ru.jsx
@@ -16,7 +16,7 @@ const ru = {
"status.show_less": "Свернуть",
"status.open": "Развернуть статус",
"status.report": "Пожаловаться",
- "status.load_more": "Показать еще",
+ "status.load_more": "Показать еще",
"video_player.toggle_sound": "Вкл./выкл. звук",
"video_player.toggle_visible": "Показать/скрыть",
"account.disclaimer": "Это пользователь с другого узла. Число может быть больше.",
diff --git a/app/assets/javascripts/components/middleware/errors.jsx b/app/assets/javascripts/components/middleware/errors.jsx
index 4aca75f1e..9a51257cb 100644
--- a/app/assets/javascripts/components/middleware/errors.jsx
+++ b/app/assets/javascripts/components/middleware/errors.jsx
@@ -22,7 +22,7 @@ export default function errorsMiddleware() {
dispatch(showAlert(title, message));
} else {
- console.error(action.error);
+ console.error(action.error); // eslint-disable-line no-console
dispatch(showAlert('Oops!', 'An unexpected error occurred.'));
}
}
diff --git a/app/assets/javascripts/components/reducers/alerts.jsx b/app/assets/javascripts/components/reducers/alerts.jsx
index 42987f649..dc0145824 100644
--- a/app/assets/javascripts/components/reducers/alerts.jsx
+++ b/app/assets/javascripts/components/reducers/alerts.jsx
@@ -9,17 +9,17 @@ const initialState = Immutable.List([]);
export default function alerts(state = initialState, action) {
switch(action.type) {
- case ALERT_SHOW:
- return state.push(Immutable.Map({
- key: state.size > 0 ? state.last().get('key') + 1 : 0,
- title: action.title,
- message: action.message
- }));
- case ALERT_DISMISS:
- return state.filterNot(item => item.get('key') === action.alert.key);
- case ALERT_CLEAR:
- return state.clear();
- default:
- return state;
+ case ALERT_SHOW:
+ return state.push(Immutable.Map({
+ key: state.size > 0 ? state.last().get('key') + 1 : 0,
+ title: action.title,
+ message: action.message
+ }));
+ case ALERT_DISMISS:
+ return state.filterNot(item => item.get('key') === action.alert.key);
+ case ALERT_CLEAR:
+ return state.clear();
+ default:
+ return state;
}
};
diff --git a/package.json b/package.json
index df496c55b..6f448238b 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,11 @@
{
"name": "mastodon",
"scripts": {
- "test": "mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.jsx",
+ "start": "babel-node ./streaming/index.js --presets es2015,stage-2",
"storybook": "start-storybook -p 9001 -c storybook",
- "start": "babel-node ./streaming/index.js --presets es2015,stage-2"
+ "test": "npm run test:lint && npm run test:mocha",
+ "test:lint": "eslint -c .eslintrc --ext=js --ext=jsx app/assets/javascripts/",
+ "test:mocha": "mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.jsx"
},
"dependencies": {
"@kadira/storybook": "^2.35.3",
@@ -74,8 +76,12 @@
"ws": "^2.1.0"
},
"devDependencies": {
- "babel-eslint": "^7.2.1",
+ "babel-eslint": "^7.2.2",
"eslint": "^3.19.0",
+ "eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.3"
+ },
+ "optionalDependencies": {
+ "fsevents": "*"
}
}
diff --git a/yarn.lock b/yarn.lock
index 7f1c48dbc..5c468a2f2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -250,6 +250,12 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"
+aria-query@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.3.0.tgz#cb8a9984e2862711c83c80ade5b8f5ca0de2b467"
+ dependencies:
+ ast-types-flow "0.0.7"
+
arr-diff@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
@@ -357,6 +363,10 @@ assertion-error@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
+ast-types-flow@0.0.7:
+ version "0.0.7"
+ resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
+
ast-types@0.9.5:
version "0.9.5"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.5.tgz#1a660a09945dbceb1f9c9cbb715002617424e04a"
@@ -511,9 +521,9 @@ babel-core@^6.11.4:
slash "^1.0.0"
source-map "^0.5.0"
-babel-eslint@^7.2.1:
- version "7.2.1"
- resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.1.tgz#079422eb73ba811e3ca0865ce87af29327f8c52f"
+babel-eslint@^7.2.2:
+ version "7.2.2"
+ resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.2.tgz#0da2cbe6554fd0fb069f19674f2db2f9c59270ff"
dependencies:
babel-code-frame "^6.22.0"
babel-traverse "^6.23.1"
@@ -2128,6 +2138,10 @@ d@1:
dependencies:
es5-ext "^0.10.9"
+damerau-levenshtein@^1.0.0:
+ version "1.0.4"
+ resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514"
+
dashdash@^1.12.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.0.tgz#29e486c5418bf0f356034a993d51686a33e84141"
@@ -2343,6 +2357,10 @@ elliptic@^6.0.0:
hash.js "^1.0.0"
inherits "^2.0.1"
+emoji-regex@^6.1.0:
+ version "6.4.2"
+ resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.4.2.tgz#a30b6fee353d406d96cfb9fa765bdc82897eff6e"
+
emojione-picker@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/emojione-picker/-/emojione-picker-2.0.1.tgz#62e58db67d37a400a883c82d39abb1cc1c8ed65a"
@@ -2542,6 +2560,17 @@ escope@^3.6.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"
+eslint-plugin-jsx-a11y@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-4.0.0.tgz#779bb0fe7b08da564a422624911de10061e048ee"
+ dependencies:
+ aria-query "^0.3.0"
+ ast-types-flow "0.0.7"
+ damerau-levenshtein "^1.0.0"
+ emoji-regex "^6.1.0"
+ jsx-ast-utils "^1.0.0"
+ object-assign "^4.0.1"
+
eslint-plugin-react@^6.10.3:
version "6.10.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78"
@@ -2886,7 +2915,7 @@ fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
-fsevents@^1.0.0:
+fsevents@*, fsevents@^1.0.0:
version "1.0.14"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.14.tgz#558e8cc38643d8ef40fe45158486d0d25758eee4"
dependencies:
@@ -3672,7 +3701,7 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.3.6"
-jsx-ast-utils@^1.3.4:
+jsx-ast-utils@^1.0.0, jsx-ast-utils@^1.3.4:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.0.tgz#5afe38868f56bc8cc7aeaef0100ba8c75bd12591"
dependencies: