treeherder/.eslintrc.js

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

Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216) Neutrino controls our frontend linting, transpilation, source-maps, testing, dev-server and optimisation of production builds. Highlights of the upgrade are: * Major version updates to the individual tools within (such as webpack, Babel and ESLint), significantly improving performance, fixing transpilation/minification correctness bugs, adding support for newer ECMAScript features, and increasing linter coverage. * Hot reloading in the dev server now works for all entry-points and not just the jobs view, shortening the feedback cycle. * Reduced bundle size due to webpack 4's tree shaking, scope hoisting, automatic shared/vendor code chunk splitting (no need for the manually maintained 'vendor' list). * CSS is now extracted out of JS, which improves performance, reduces bundle size and prevents the initial white flash of un-styled content. * Support for dynamic imports/code splitting (needed for bug 1502192). * Support for Jest via a new Jest preset (unblocks bug 1364045). * Support for public class field declarations (unblocks bug 1480166). * Improved source-maps (increases the quality of production exception trace-backs and fixes several debugger breakpoint bugs). * Reduced amount of custom configuration required for our fairly complex frontend needs, reducing maintenance burden and allowing for easier future Neutrino upgrades. In addition this PR: * Fixes the WhiteNoise `immutable_file_test()` regex, so that it now correctly enables browser caching of images, fonts and source maps. * Enables webpack-dev-server's overlay feature, which displays any compilation errors in the browser, saving having to switch back to the console (this can be enabled for warnings too if desired). * Enables webpack-dev-server's automatic browser-opening feature, which saves having to manually navigate to `localhost:5000` after running `yarn start`. * Switches Karma tests to run Firefox in headless mode, reducing the workflow disruption when running `yarn test`. * Uses the new webpack `performance` option to enable maximum asset file size thresholds, to help prevent bundle-size regressions. * Rewrites the `package.json` script commands so that they now work correctly on Windows, even when setting environment variables. Performance comparison: * Local `yarn build`: - Cached: 2m34s -> 23s - Uncached: 2m34s -> 58s * Local `yarn start`: - Cached: 34.5s -> 13.6s - Uncached: 34.5s -> 31.3s * Local `yarn test` - Cached: 61.5s -> 19.8s - Uncached: 61.5s -> 22.0s * Local `yarn lint` - Cached: 3.8s -> 1.8s - Uncached: 13.7s -> 13.4s * Travis end-to-end time: 9 minutes -> 6 minutes * Heroku deploy end-to-end time: 14 minutes -> 9 minutes
2018-11-02 21:48:28 +03:00
module.exports = {
root: true,
extends: [
'eslint-config-airbnb',
// We use Prettier instead of AirBnb for style-related rules (see .prettierrc.js).
process.env.NODE_ENV === 'development'
? // Disables the AirBnB style rules but does not enable Prettier
// (to reduce the amount of console noise when using `yarn start`).
'prettier'
: // The above plus enables the prettier rule.
'plugin:prettier/recommended',
// Disable React-related AirBnB style rules.
'prettier/react',
'plugin:jest/recommended',
'plugin:jest/style',
],
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216) Neutrino controls our frontend linting, transpilation, source-maps, testing, dev-server and optimisation of production builds. Highlights of the upgrade are: * Major version updates to the individual tools within (such as webpack, Babel and ESLint), significantly improving performance, fixing transpilation/minification correctness bugs, adding support for newer ECMAScript features, and increasing linter coverage. * Hot reloading in the dev server now works for all entry-points and not just the jobs view, shortening the feedback cycle. * Reduced bundle size due to webpack 4's tree shaking, scope hoisting, automatic shared/vendor code chunk splitting (no need for the manually maintained 'vendor' list). * CSS is now extracted out of JS, which improves performance, reduces bundle size and prevents the initial white flash of un-styled content. * Support for dynamic imports/code splitting (needed for bug 1502192). * Support for Jest via a new Jest preset (unblocks bug 1364045). * Support for public class field declarations (unblocks bug 1480166). * Improved source-maps (increases the quality of production exception trace-backs and fixes several debugger breakpoint bugs). * Reduced amount of custom configuration required for our fairly complex frontend needs, reducing maintenance burden and allowing for easier future Neutrino upgrades. In addition this PR: * Fixes the WhiteNoise `immutable_file_test()` regex, so that it now correctly enables browser caching of images, fonts and source maps. * Enables webpack-dev-server's overlay feature, which displays any compilation errors in the browser, saving having to switch back to the console (this can be enabled for warnings too if desired). * Enables webpack-dev-server's automatic browser-opening feature, which saves having to manually navigate to `localhost:5000` after running `yarn start`. * Switches Karma tests to run Firefox in headless mode, reducing the workflow disruption when running `yarn test`. * Uses the new webpack `performance` option to enable maximum asset file size thresholds, to help prevent bundle-size regressions. * Rewrites the `package.json` script commands so that they now work correctly on Windows, even when setting environment variables. Performance comparison: * Local `yarn build`: - Cached: 2m34s -> 23s - Uncached: 2m34s -> 58s * Local `yarn start`: - Cached: 34.5s -> 13.6s - Uncached: 34.5s -> 31.3s * Local `yarn test` - Cached: 61.5s -> 19.8s - Uncached: 61.5s -> 22.0s * Local `yarn lint` - Cached: 3.8s -> 1.8s - Uncached: 13.7s -> 13.4s * Travis end-to-end time: 9 minutes -> 6 minutes * Heroku deploy end-to-end time: 14 minutes -> 9 minutes
2018-11-02 21:48:28 +03:00
parser: 'babel-eslint',
settings: {
react: {
version: '16.6',
},
},
env: {
browser: true,
},
rules: {
'class-methods-use-this': 'off',
'consistent-return': 'off',
'default-case': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'no-alert': 'off',
'no-continue': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
'prefer-promise-reject-errors': 'off',
'react/destructuring-assignment': 'off',
2019-08-21 23:14:05 +03:00
'react/jsx-fragments': 'off',
'react/jsx-props-no-spreading': 'off',
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216) Neutrino controls our frontend linting, transpilation, source-maps, testing, dev-server and optimisation of production builds. Highlights of the upgrade are: * Major version updates to the individual tools within (such as webpack, Babel and ESLint), significantly improving performance, fixing transpilation/minification correctness bugs, adding support for newer ECMAScript features, and increasing linter coverage. * Hot reloading in the dev server now works for all entry-points and not just the jobs view, shortening the feedback cycle. * Reduced bundle size due to webpack 4's tree shaking, scope hoisting, automatic shared/vendor code chunk splitting (no need for the manually maintained 'vendor' list). * CSS is now extracted out of JS, which improves performance, reduces bundle size and prevents the initial white flash of un-styled content. * Support for dynamic imports/code splitting (needed for bug 1502192). * Support for Jest via a new Jest preset (unblocks bug 1364045). * Support for public class field declarations (unblocks bug 1480166). * Improved source-maps (increases the quality of production exception trace-backs and fixes several debugger breakpoint bugs). * Reduced amount of custom configuration required for our fairly complex frontend needs, reducing maintenance burden and allowing for easier future Neutrino upgrades. In addition this PR: * Fixes the WhiteNoise `immutable_file_test()` regex, so that it now correctly enables browser caching of images, fonts and source maps. * Enables webpack-dev-server's overlay feature, which displays any compilation errors in the browser, saving having to switch back to the console (this can be enabled for warnings too if desired). * Enables webpack-dev-server's automatic browser-opening feature, which saves having to manually navigate to `localhost:5000` after running `yarn start`. * Switches Karma tests to run Firefox in headless mode, reducing the workflow disruption when running `yarn test`. * Uses the new webpack `performance` option to enable maximum asset file size thresholds, to help prevent bundle-size regressions. * Rewrites the `package.json` script commands so that they now work correctly on Windows, even when setting environment variables. Performance comparison: * Local `yarn build`: - Cached: 2m34s -> 23s - Uncached: 2m34s -> 58s * Local `yarn start`: - Cached: 34.5s -> 13.6s - Uncached: 34.5s -> 31.3s * Local `yarn test` - Cached: 61.5s -> 19.8s - Uncached: 61.5s -> 22.0s * Local `yarn lint` - Cached: 3.8s -> 1.8s - Uncached: 13.7s -> 13.4s * Travis end-to-end time: 9 minutes -> 6 minutes * Heroku deploy end-to-end time: 14 minutes -> 9 minutes
2018-11-02 21:48:28 +03:00
'react/forbid-prop-types': 'off',
'react/prop-types': 'off',
// Override AirBnB's config for this rule to make it more strict.
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
'import/order': [
'error',
{
'newlines-between': 'always',
},
],
Bug 1364894 - Upgrade from Neutrino 4 to 9 (#4216) Neutrino controls our frontend linting, transpilation, source-maps, testing, dev-server and optimisation of production builds. Highlights of the upgrade are: * Major version updates to the individual tools within (such as webpack, Babel and ESLint), significantly improving performance, fixing transpilation/minification correctness bugs, adding support for newer ECMAScript features, and increasing linter coverage. * Hot reloading in the dev server now works for all entry-points and not just the jobs view, shortening the feedback cycle. * Reduced bundle size due to webpack 4's tree shaking, scope hoisting, automatic shared/vendor code chunk splitting (no need for the manually maintained 'vendor' list). * CSS is now extracted out of JS, which improves performance, reduces bundle size and prevents the initial white flash of un-styled content. * Support for dynamic imports/code splitting (needed for bug 1502192). * Support for Jest via a new Jest preset (unblocks bug 1364045). * Support for public class field declarations (unblocks bug 1480166). * Improved source-maps (increases the quality of production exception trace-backs and fixes several debugger breakpoint bugs). * Reduced amount of custom configuration required for our fairly complex frontend needs, reducing maintenance burden and allowing for easier future Neutrino upgrades. In addition this PR: * Fixes the WhiteNoise `immutable_file_test()` regex, so that it now correctly enables browser caching of images, fonts and source maps. * Enables webpack-dev-server's overlay feature, which displays any compilation errors in the browser, saving having to switch back to the console (this can be enabled for warnings too if desired). * Enables webpack-dev-server's automatic browser-opening feature, which saves having to manually navigate to `localhost:5000` after running `yarn start`. * Switches Karma tests to run Firefox in headless mode, reducing the workflow disruption when running `yarn test`. * Uses the new webpack `performance` option to enable maximum asset file size thresholds, to help prevent bundle-size regressions. * Rewrites the `package.json` script commands so that they now work correctly on Windows, even when setting environment variables. Performance comparison: * Local `yarn build`: - Cached: 2m34s -> 23s - Uncached: 2m34s -> 58s * Local `yarn start`: - Cached: 34.5s -> 13.6s - Uncached: 34.5s -> 31.3s * Local `yarn test` - Cached: 61.5s -> 19.8s - Uncached: 61.5s -> 22.0s * Local `yarn lint` - Cached: 3.8s -> 1.8s - Uncached: 13.7s -> 13.4s * Travis end-to-end time: 9 minutes -> 6 minutes * Heroku deploy end-to-end time: 14 minutes -> 9 minutes
2018-11-02 21:48:28 +03:00
},
};