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

@@ -1,2 +1,3 @@
src/app/_helpers/data
node_modules
src/index.html

View File

@@ -1,76 +1,43 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"extends": ["@openstapps/eslint-config"],
"overrides": [
{
"files": ["*.ts"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:jsdoc/recommended",
"plugin:unicorn/recommended",
"prettier"
"plugin:@angular-eslint/template/process-inline-templates"
],
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc"],
"settings": {
"jsdoc": {
"mode": "typescript"
}
},
"rules": {
"unicorn/filename-case": "error",
"unicorn/no-array-reduce": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-object-from-entries": "off",
"unicorn/prefer-node-protocol": "off",
"unicorn/no-process-exit": "off",
"unicorn/prefer-event-target": "off",
"unicorn/prevent-abbreviations": [
"warn",
{
"replacements": {
"ref": false,
"i": false
}
}
],
"unicorn/no-nested-ternary": "off",
"unicorn/better-regex": "off",
"unicorn/no-non-null-assertion": "off",
"unicorn/consistent-function-scoping": ["error", {"checkArrowFunctions": false}],
"jsdoc/no-types": "error",
"jsdoc/require-param": "off",
"jsdoc/require-param-description": "error",
"jsdoc/check-param-names": "error",
"jsdoc/require-returns": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/lines-between-class-members": ["error", "always"],
"@typescript-eslint/no-explicit-any": "error",
"@angular-eslint/use-lifecycle-interface": "error"
"@angular-eslint/use-lifecycle-interface": "error",
"no-console": "off"
}
},
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"]
"plugins": ["header"],
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
"rules": {
"header/header": [
2,
"block-html",
[
"~ 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/>."
]
]
}
}
]
}

View File

@@ -138,6 +138,7 @@
"@ionic/angular-toolkit": "11.0.1",
"@ionic/cli": "7.2.0",
"@openstapps/prettier-config": "workspace:*",
"@openstapps/eslint-config": "workspace:*",
"@openstapps/tsconfig": "workspace:*",
"@types/fontkit": "2.0.7",
"@types/geojson": "1.0.6",
@@ -154,11 +155,6 @@
"@typescript-eslint/parser": "7.2.0",
"cordova-res": "0.15.4",
"cypress": "13.7.0",
"eslint": "8.57.0",
"eslint-plugin-jsdoc": "48.2.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unicorn": "51.0.1",
"fast-deep-equal": "3.1.3",
"fontkit": "2.0.2",
"glob": "10.3.10",
"http-server": "14.1.1",