Feature/enforce license notice in each file via eslint rule (#304)
* [ESLint] Add "eslint-plugin-header" as dev dependency * [ESLint::eslint-plugin-header] Setup rule * [ESLint::eslint-plugin-header] Fix errors
This commit is contained in:
18
.eslintrc.js
18
.eslintrc.js
@@ -1,10 +1,26 @@
|
||||
module.exports = {
|
||||
extends: ['airbnb', 'airbnb-typescript', 'prettier'],
|
||||
plugins: ['@typescript-eslint', 'no-relative-import-paths', 'prettier'],
|
||||
plugins: ['@typescript-eslint', 'no-relative-import-paths', 'prettier', 'header'],
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
rules: {
|
||||
'header/header': [
|
||||
'error',
|
||||
'block', // comment type
|
||||
[ // expected file header comment
|
||||
// the spaces are important, otherwise, the rule will mark it as an error
|
||||
'',
|
||||
' * Copyright (C) Contributors to the Suwayomi project',
|
||||
' *',
|
||||
' * This Source Code Form is subject to the terms of the Mozilla Public',
|
||||
' * License, v. 2.0. If a copy of the MPL was not distributed with this',
|
||||
' * file, You can obtain one at https://mozilla.org/MPL/2.0/.',
|
||||
' ',
|
||||
],
|
||||
2, // number of new lines after comment
|
||||
],
|
||||
|
||||
'prettier/prettier': 'error',
|
||||
|
||||
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
||||
|
||||
Reference in New Issue
Block a user