-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
ci: upgrade Node.js version (#619)
- Upgrades Node.js version in Github actions - Removes @scaleleap/utils package
1 parent
aecb3a2
commit c86924b
Showing
7 changed files
with
2,676 additions
and
6,899 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,203 @@ | ||
module.exports = require('@scaleleap/utils/eslint') | ||
const eslint = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 9, | ||
sourceType: 'module', | ||
project: './tsconfig.json', | ||
}, | ||
ignorePatterns: ['.eslintrc.js', 'dist'], | ||
env: { | ||
node: true, | ||
browser: true, | ||
es6: true, | ||
jest: true, | ||
'jest/globals': true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'airbnb-base', | ||
'prettier', | ||
'plugin:eslint-comments/recommended', | ||
'plugin:jest/all', | ||
'plugin:jest-formatting/strict', | ||
'plugin:sonarjs/recommended', | ||
'plugin:unicorn/recommended', | ||
], | ||
plugins: [ | ||
'import', | ||
'prettier', | ||
'@typescript-eslint', | ||
'simple-import-sort', | ||
'jest', | ||
'jest-formatting', | ||
'sonarjs', | ||
], | ||
globals: {}, | ||
rules: { | ||
curly: ['error', 'all'], | ||
|
||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
endOfLine: 'lf', | ||
printWidth: 100, | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}, | ||
], | ||
|
||
'no-underscore-dangle': 'off', | ||
'no-restricted-syntax': 'off', | ||
|
||
'@typescript-eslint/explicit-member-accessibility': 'off', | ||
'@typescript-eslint/consistent-type-assertions': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'import/prefer-default-export': 'off', | ||
|
||
'class-methods-use-this': 'off', | ||
'sort-imports': 'off', | ||
'import/order': 'off', | ||
'import/extensions': 'off', | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: [ | ||
'**/*.test.ts', | ||
'test/**/*.ts', | ||
], | ||
}, | ||
], | ||
|
||
'simple-import-sort/imports': 'error', | ||
'jest/no-hooks': 'off', | ||
'jest/valid-title': [ | ||
'error', | ||
{ | ||
ignoreTypeOfDescribeName: true, | ||
} | ||
], | ||
|
||
'@typescript-eslint/no-unnecessary-type-constraint': 'off', | ||
'default-param-last': 'off', | ||
'jest/max-expects': 'off', | ||
'jest/no-conditional-in-test': 'off', | ||
'jest/no-untyped-mock-factory': 'off', | ||
'jest/prefer-mock-promise-shorthand': 'off', | ||
'jest/prefer-snapshot-hint': 'off', | ||
'jest/require-hook': 'off', | ||
'jest/unbound-method': 'off', | ||
'no-promise-executor-return': 'off', | ||
'prefer-regex-literals': 'off', | ||
'sonarjs/no-gratuitous-expressions': 'off', | ||
'sonarjs/prefer-single-boolean-return': 'off', | ||
'unicorn/expiring-todo-comments': 'off', | ||
'unicorn/no-await-expression-member': 'off', | ||
'unicorn/no-empty-file': 'off', | ||
'unicorn/no-useless-promise-resolve-reject': 'off', | ||
'unicorn/prefer-export-from': 'off', | ||
'unicorn/prefer-json-parse-buffer': 'off', | ||
'unicorn/prefer-module': 'off', | ||
}, | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts'], | ||
}, | ||
'import/resolver': { | ||
typescript: { | ||
// https://github.com/benmosher/eslint-plugin-import/issues/1485#issuecomment-535351922 | ||
}, | ||
node: { | ||
extensions: ['.js', '.ts', '.json'], | ||
}, | ||
}, | ||
'import/extensions': ['.js', '.ts', '.mjs'], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'consistent-return': 'off', | ||
|
||
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/781 | ||
'unicorn/no-array-callback-reference': 'off', | ||
|
||
// duplicate of @typescript-eslint/no-unused-vars | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': 'error', | ||
|
||
// https://github.com/typescript-eslint/typescript-eslint/issues/662#issuecomment-507081586 | ||
'no-undef': 'off', | ||
|
||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': ['error'], | ||
|
||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md | ||
// note you must disable the base rule as it can report incorrect errors | ||
'no-useless-constructor': 'off', | ||
'@typescript-eslint/no-useless-constructor': ['error'], | ||
|
||
// note you must disable the base rule as it can report incorrect errors | ||
'no-empty-function': 'off', | ||
'@typescript-eslint/no-empty-function': ['error'], | ||
|
||
'no-redeclare': 'off', | ||
|
||
'@typescript-eslint/no-redeclare': 'off', | ||
|
||
'no-use-before-define': 'off', | ||
'@typescript-eslint/no-use-before-define': ['error'], | ||
|
||
// perfer to use single quites | ||
'@typescript-eslint/quotes': [ | ||
'error', | ||
'single', | ||
{ | ||
avoidEscape: true, | ||
allowTemplateLiterals: true, | ||
}, | ||
], | ||
|
||
'unicorn/prefer-top-level-await': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['*.test.ts'], | ||
rules: { | ||
'max-classes-per-file': 'off', | ||
}, | ||
}, | ||
], | ||
} | ||
|
||
eslint.rules['no-new'] = 0 | ||
eslint.rules['@typescript-eslint/explicit-module-boundary-types'] = 'off' | ||
|
||
/** | ||
* This looks like a garbage ESM rule. | ||
* Wants everything prefixed with "node:*" | ||
*/ | ||
eslint.rules['unicorn/prefer-node-protocol'] = 0 | ||
|
||
eslint.rules['unicorn/numeric-separators-style'] = 0 | ||
|
||
eslint.rules['jest/expect-expect'] = [ | ||
'error', | ||
{ | ||
assertFunctionNames: ['expect', 'expectCDK'], | ||
}, | ||
] | ||
|
||
eslint.rules['@typescript-eslint/no-unused-vars'] = [ | ||
'error', | ||
{ | ||
ignoreRestSiblings: true, | ||
}, | ||
] | ||
|
||
eslint.rules['@typescript-eslint/no-unsafe-declaration-merging'] = 0 | ||
|
||
module.exports = eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ jobs: | |
strategy: | ||
matrix: | ||
node: | ||
- 14 | ||
- 16 | ||
- 18 | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"target": "ES2019" | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
"src/**/*", | ||
"test/**/*.ts" | ||
] | ||
} |