Skip to content

Commit

Permalink
feat: add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
lekhmanrus committed Mar 1, 2024
1 parent 02fbcfa commit 5ca55a3
Show file tree
Hide file tree
Showing 22 changed files with 12,792 additions and 5,666 deletions.
5 changes: 5 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [ "@commitlint/config-conventional" ],
"parserPreset": "conventional-changelog-angular",
"formatter": "@commitlint/format"
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
angular/dist/
217 changes: 217 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
{
"root": true,
"overrides": [
{
"files": [
"*.ts"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [ ".ts" ]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "."
}
}
},
"parserOptions": {
"project": [
"tsconfig.json",
"angular/tsconfig.app.json"
],
"createDefaultProgram": true
},
"plugins": [
"@angular-eslint",
"@typescript-eslint",
"import",
"jsdoc",
"prefer-arrow",
"rxjs",
"unicorn"
],
"extends": [
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:jsdoc/recommended",
"plugin:rxjs/recommended",
"plugin:import/errors"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": [ "Component" ]
}
],
"@angular-eslint/no-forward-ref": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple"
}
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/member-ordering": [
0,
[
// Index signature
"signature",

// Fields
"public-static-field",
"public-decorated-field",
"public-instance-field",
"public-abstract-field",
"protected-static-field",
"protected-decorated-field",
"protected-instance-field",
"protected-abstract-field",
"private-static-field",
"private-decorated-field",
"private-instance-field",
"private-abstract-field",

// Constructors
"public-constructor",
"protected-constructor",
"private-constructor",

// Methods
"public-static-method",
"public-decorated-method",
"public-instance-method",
"public-abstract-method",
"protected-static-method",
"protected-decorated-method",
"protected-instance-method",
"protected-abstract-method",
"private-static-method",
"private-decorated-method",
"private-instance-method",
"private-abstract-method"
]
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"types": [ "boolean" ],
"format": [ "PascalCase" ],
"prefix": [ "is", "are", "should", "has", "can", "did", "will" ]
},
{
"selector": "enumMember",
"format": [ "PascalCase" ]
}
],
"jsdoc/newline-after-description": 0,
"jsdoc/require-param-type": 0,
"jsdoc/require-property-type": 0,
"jsdoc/require-returns-type": 0,
"jsdoc/require-returns": [
"error",
{ "checkGetters": false }
],
"prefer-arrow/prefer-arrow-functions": [
"warn",
{
"disallowPrototype": true,
"singleReturnOnly": false,
"classPropertiesAllowed": false
}
],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": "error",
"import/order": "off",
"max-classes-per-file": [
"error",
1
],
"max-len": [
"error",
{
"code": 100
}
],
"no-redeclare": "error",
"no-underscore-dangle": "off",
"quote-props": [ "error", "consistent-as-needed" ],
"no-duplicate-imports": "error",
"no-irregular-whitespace": "error",
"no-multiple-empty-lines": [
"error",
{
"max": 2
}
],
"prefer-template": "error",
"rxjs/no-internal": "error",
"unicorn/filename-case": "error",
"import/no-deprecated": "off",
"import/no-unresolved": "warn"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": { }
},
{
"files": [
"**/**/components/modals/**/**/*.ts"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": [ "ModalComponent" ]
}
]
}
},
{
"files": [
"**/**/components/pages/**/**/*.ts"
],
"rules": {
"@angular-eslint/component-class-suffix": [
"error",
{
"suffixes": [ "PageComponent" ]
}
]
}
}
]
}
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Bug Report
description: Report a bug in RealShotPDF
labels: ["bug"]
---
body:
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of the problem.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
value: |
Steps to reproduce:
1.
2.
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: What behavior were you expecting to see?
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: What behavior did you actually see?
validations:
required: true
- type: textarea
id: environment
attributes:
label: Environment
value: |
- RealShotPDF version:
- Chrome version:
- Operating System:
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Documentation
description: Suggest an improvement to our documentation
labels: ["documentation"]
body:
- type: textarea
id: description
attributes:
label: Documentation Feedback
description: |
Provide a brief summary of what you would like to see changed in our documentation.
Feel free to provide any suggestions of content or examples you’d like us to include.
validations:
required: true
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Feature
description: Propose a new feature for RealShotPDF
labels: ["enhancement"]
body:
- type: textarea
id: description
attributes:
label: Feature Description
description: Provide a brief summary of the feature you would like to see.
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use Case
description: Describe the use case(s) that the proposed feature would enable.
validations:
required: false
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## PR Checklist
Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)


## PR Type
What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [ ] Bugfix
- [ ] Feature
- [ ] Refactoring
- [ ] Build related changes
- [ ] Documentation
- [ ] Other: <!-- Please describe -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A


## What is the new behavior?


## Does this PR introduce a breaking change?

- [ ] Yes
- [ ] No


<!-- If this PR contains a breaking change, please describe. -->


## Other information
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
- run: npm ci
- run: npm run build:production
- uses: actions/upload-artifact@v4
with:
name: real-shot-pdf
path: ${{ format('real-shot-pdf-v{0}.zip', steps.package-version.outputs.current-version) }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run lint
Loading

0 comments on commit 5ca55a3

Please sign in to comment.