pontoon/.eslintrc.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 строки
1.8 KiB
JavaScript
Исходник Обычный вид История

/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:react/recommended'],
env: {
es6: true,
browser: true,
Fix bug 1473330 - Translate.Next architecture (#989) * Add React frontend for Translate app. This has been set up using create-react-app. * Integrate new Translate app into django. This provides a working prod and dev environment. In production, django will serve the index.html file as a template, and files built by webpack will be collected and distributed with other django static files. In development, all requests are proxied to the dev webpack server, allowing all dev niceties to be used. * Add support for websockets. * Add a bit of documentation specific to our use case. * Add redux for state management. * Show a very basic list of entities. * Enable absolute path import. * Add links to various resources. * Rearchitecture code into modules. All features should be self-contained into a module in src/modules/. All code that is shared amongst several modules should go into a module in src/core/. * Remove unused assets. * Add some architecture documentation. * Add Flow to current code for type checking. * Add unit testing with jest, enzyme and sinon. * Extend documentation, talk about type checking, modules, and list tools we use. * Move CSS rules closer to actual component. * Add django-waffle and hide translate.next behind a switch. * Better structure for the README file. * Build and test frontend in travis. * Of course it is better if dependencies are installed. * Use pushd to run commands in frontend. * Configure eslint and fix errors. * Add more code comments. * Improve documentation around local dev and Flow. * Add tests for the Translate view. * Improve documentation. * Fix serving static files for development. * Integrate Translate.Next with out docker setup. * Remove debug. * Use DEV instead of DEBUG. * Much review. Many comments. Wow better! * Flatter module public interfaces. * Import correctly from modules. * Fix docker webapp run.
2018-07-18 12:39:52 +03:00
jest: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
},
sourceType: 'module',
babelOptions: {
presets: ['@babel/preset-react'],
},
requireConfigFile: false,
},
globals: {
gettext: false,
ngettext: false,
interpolate: false,
l: false,
expect: false,
test: false,
browser: false,
jest: false,
Promise: false,
Set: false,
URLSearchParameters: false,
FormData: false,
require: false,
shortcut: false,
sorttable: false,
$: false,
Pontoon: false,
jQuery: false,
Clipboard: false,
Chart: false,
NProgress: false,
diff_match_patch: false,
Highcharts: false,
Sideshow: false,
editor: false,
DIFF_INSERT: false,
DIFF_EQUAL: false,
DIFF_DELETE: false,
ga: false,
process: false,
generalShortcutsHandler: true,
traversalShortcutsHandler: true,
editorShortcutsHandler: true,
},
plugins: ['react'],
rules: {
curly: 'error',
'react/display-name': 0,
'react/prefer-es6-class': 1,
'react/prefer-stateless-function': 0,
'react/prop-types': 0,
'react/jsx-key': 0,
'react/jsx-uses-react': 1,
'react/jsx-uses-vars': 1,
'no-unused-vars': [
'error',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
'no-console': 1,
'no-var': 'error',
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
},
settings: {
react: {
version: 'detect',
},
},
};