feat: eslint license header plugin

This commit is contained in:
2024-07-15 13:48:44 +02:00
parent 2a1a7a5d5b
commit f8efb7db57
9 changed files with 110 additions and 85 deletions

View File

@@ -22,7 +22,7 @@ const config = {
'plugin:unicorn/recommended',
'prettier',
],
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc'],
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc', 'header'],
settings: {
jsdoc: {
mode: 'typescript',
@@ -36,6 +36,7 @@ const config = {
'unicorn/prefer-node-protocol': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/prefer-event-target': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
@@ -77,6 +78,27 @@ const config = {
},
],
'header/header': [
2,
'block',
[
'',
' * Copyright (C) 2023 StApps',
' * This program is free software: you can redistribute it and/or modify it',
' * under the terms of the GNU General Public License as published by the Free',
' * Software Foundation, version 3.',
' *',
' * This program is distributed in the hope that it will be useful, but WITHOUT',
' * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or',
' * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for',
' * more details.',
' *',
' * You should have received a copy of the GNU General Public License along with',
' * this program. If not, see <https://www.gnu.org/licenses/>.',
' ',
],
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',

View File

@@ -1,14 +0,0 @@
Copyright (C) {{year}} {{author}}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -22,11 +22,13 @@
"typescript": "5.4.2"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jsdoc": "48.2.1",
"eslint-plugin-unicorn": "51.0.1"
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"eslint": "8.43.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-jsdoc": "46.4.2",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "47.0.0",
"eslint-plugin-header": "3.1.1"
}
}