mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-24 21:48:02 +02:00
chore(v2): add ESLint rule to check for Facebook copyright headers in JS files (#1301)
This commit is contained in:
parent
3f9cc96330
commit
1edbeecbe5
6 changed files with 42 additions and 18 deletions
22
.eslintrc.js
22
.eslintrc.js
|
@ -21,20 +21,36 @@ module.exports = {
|
|||
allowImportExportEverywhere: true,
|
||||
},
|
||||
extends: ['airbnb', 'prettier', 'prettier/react'],
|
||||
plugins: ['react-hooks'],
|
||||
plugins: ['react-hooks', 'header'],
|
||||
rules: {
|
||||
'class-methods-use-this': OFF, // It's a way of allowing private variables.
|
||||
'no-console': OFF,
|
||||
'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,
|
||||
'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.
|
||||
'import/no-unresolved': WARNING, // Because it couldn't resolve webpack alias.
|
||||
'react/prefer-stateless-function': WARNING,
|
||||
'react-hooks/rules-of-hooks': ERROR,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue