docusaurus/.eslintrc.js
Yangshun Tay 96cb4672d5 feat(v2): implement ComponentCreator (#1366)
* v2(feat): convert blog to view-driven content queries

* feat(v2): port blog to use ContentRenderer

* misc(v2): fix test and change ContentRenderer url

* avoid chunkName collision

* avoid chunkname collision more

* fix(v2): fix content-renderer ssr problem (#1367)

* wip

* avoid chunk names collision

* ContentRenderer is a wrapper for Loadable

* convert docs and pages

* nits and rename

* rename routeModules -> modules

* remove lodash from component creator

* resolve chunk not being picked up correctly

* add comment for explanation

* small refactoring
2019-04-16 22:18:29 +08:00

58 lines
1.8 KiB
JavaScript

/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const OFF = 0;
const WARNING = 1;
const ERROR = 2;
module.exports = {
env: {
browser: true,
commonjs: true,
jest: true,
node: true,
},
parser: 'babel-eslint',
parserOptions: {
allowImportExportEverywhere: true,
},
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['react-hooks', 'header'],
rules: {
'class-methods-use-this': OFF, // It's a way of allowing private variables.
'func-names': OFF,
'import/no-unresolved': WARNING, // Because it couldn't resolve webpack alias.
'header/header': [
ERROR,
'block',
[
'*',
{
pattern:
' \\* Copyright \\(c\\) \\d{4}-present\\, Facebook\\, Inc\\.',
template: ' * Copyright (c) 2017-present, Facebook, Inc.',
},
' *',
' * This source code is licensed under the MIT license found in the',
' * LICENSE file in the root directory of this source tree.',
' ',
],
],
'jsx-a11y/click-events-have-key-events': OFF, // Revisit in future™
'jsx-a11y/no-noninteractive-element-interactions': OFF, // Revisit in future™
'no-console': OFF,
'no-underscore-dangle': OFF,
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
'react/jsx-filename-extension': OFF,
'react/jsx-one-expression-per-line': OFF,
'react/no-array-index-key': OFF, // Sometimes its ok, e.g. non-changing data.
'react/prop-types': OFF,
'react/destructuring-assignment': OFF, // Too many lines.
'react/prefer-stateless-function': WARNING,
'react-hooks/rules-of-hooks': ERROR,
},
};