Skip to content

Commit

Permalink
GH-0 fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
akefirad committed Sep 7, 2023
1 parent 494bebe commit 31d13cf
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 58 deletions.
105 changes: 52 additions & 53 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,24 @@ globals:
SharedArrayBuffer: readonly

ignorePatterns:
- '!.*'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/coverage/.*'
- '*.json'
- "!.*"
- "**/node_modules/.*"
- "**/dist/.*"
- "**/coverage/.*"

parser: '@typescript-eslint/parser'
parser: "@typescript-eslint/parser"

parserOptions:
ecmaVersion: 2023
sourceType: module
project:
- './.github/linters/tsconfig.json'
- './tsconfig.json'
- "./.github/linters/tsconfig.json"
- "./tsconfig.json"

plugins:
- jest
- "prettier"
- '@typescript-eslint'
- "@typescript-eslint"

extends:
- eslint:recommended
Expand All @@ -36,48 +35,48 @@ extends:

rules:
{
'camelcase': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'semi': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['warn', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
"camelcase": "off",
"eslint-comments/no-use": "off",
"eslint-comments/no-unused-disable": "off",
"i18n-text/no-en": "off",
"import/no-namespace": "off",
"no-console": "off",
"no-unused-vars": "off",
"prettier/prettier": "error",
"semi": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-member-accessibility":
["error", { "accessibility": "no-public" }],
"@typescript-eslint/explicit-function-return-type":
["warn", { "allowExpressions": true }],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/semi": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error",
}
2 changes: 1 addition & 1 deletion .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ rules:
present: false
line-length:
level: warning
max: 80
max: 100
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_JSCPD: false
FILTER_REGEX_EXCLUDE: ".*dist/.*.js" # why the ignorePattern in eslintrc.yml doesn't work?
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# LoadEnv GitHub Action

## Examples

```yaml
jobs:
simple:
Expand All @@ -17,16 +18,18 @@ jobs:
name: Loads `./path/to/.env`, expands, checks, and export variables
with:
files: ./path/to/.env
strict: true # default true
expand-vars: true # default true
export-vars: true # default true
additional-vars: '${{ toJSON(vars) }}' # to make them avialbe while expanding!!!
strict: true # default true
expand-vars: true # default true
export-vars: true # default true
additional-vars: "${{ toJSON(vars) }}" # to make them avialbe while expanding!!!
- name: Use output variables
run: echo ${{ steps.loadenv.FOO }} ${{ steps.loadenv.BAR }}
- name: Use exported variables
run: echo $FOO $BAR
```
See [tests.yml](.github/workflows/tests.yml) file for different ways of using the action.
## API
See [action.yml](action.yml) file for full API.

0 comments on commit 31d13cf

Please sign in to comment.