Unverified Commit 0de5c66f authored by Ivan's avatar Ivan Committed by GitHub
Browse files

Add and configure ESLint and update configuration for Prettier (#458)

* Add ESLint config and update Prettier

* Update test files

* Rebuild action

* Update docs

* Update licenses

* Update tsconfig

* Rebuild action

* Update tsconfig.json

* Fix console.time calls

* Rebuild action

* Rebuild action on Linux
parent ea15b3b9
Loading
Loading
Loading
Loading
+6
Changes for .eslintignore: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Ignore list
/*

# Do not ignore these folders:
!__tests__/
!src/
 No newline at end of file
+49
Changes for .eslintrc.js: 49 added lines, 0 removed lines.
Original line number Diff line number Diff line
module.exports = {
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:eslint-plugin-jest/recommended',
    'eslint-config-prettier'
  ],
  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint', 'eslint-plugin-jest'],
  rules: {
    '@typescript-eslint/no-require-imports': 'error',
    '@typescript-eslint/no-non-null-assertion': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-empty-function': 'off',
    '@typescript-eslint/ban-ts-comment': [
      'error',
      {
        'ts-ignore': 'allow-with-description'
      }
    ],
    'no-console': 'error',
    'yoda': 'error',
    'prefer-const': [
      'error',
      {
        destructuring: 'all'
      }
    ],
    'no-control-regex': 'off',
    'no-constant-condition': ['error', {checkLoops: false}]
  },
  overrides: [
    {
      files: ['**/*{test,spec}.ts'],
      rules: {
        '@typescript-eslint/no-unused-vars': 'off',
        'jest/no-standalone-expect': 'off',
        'jest/no-conditional-expect': 'off',
        'no-console': 'off',

      }
    }
  ],
  env: {
    node: true,
    es6: true,
    'jest/globals': true
  }
};
+1
Changes for .gitattributes: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
* text=auto eol=lf
dist/index.js    -diff -merge
dist/index.js    linguist-generated=true
.licenses/** -diff linguist-generated=true
−1
Changes for .github/workflows/e2e-cache.yml: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@ jobs:
            exit 1
          fi

      
      - name: Check files to cache on ubuntu-latest
        if: matrix.os == 'ubuntu-latest'
        run: |
+9 −1
Changes for .github/workflows/e2e-versions.yml: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -21,7 +21,15 @@ jobs:
      fail-fast: false
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
        distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ] # internally 'adopt-hotspot' is the same as 'adopt'
        distribution: [
            'temurin',
            'adopt',
            'adopt-openj9',
            'zulu',
            'liberica',
            'microsoft',
            'corretto'
          ] # internally 'adopt-hotspot' is the same as 'adopt'
        version: ['8', '11', '16']
        exclude:
          - distribution: microsoft
Loading