Skip to content

Commit

Permalink
More fixes to get linting to work again
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh committed Jun 26, 2024
1 parent b7ee743 commit 6da9414
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 330 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
lib/
dist/
node_modules/
coverage/
jest.config.js
84 changes: 84 additions & 0 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
env:
node: true
es6: true
jest: true

globals:
Atomics: readonly
SharedArrayBuffer: readonly

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

parser: '@typescript-eslint/parser'

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

plugins:
- jest
- '@typescript-eslint'

extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:github/recommended
- plugin:jest/recommended

rules:
{
'jest/no-export': 'off',
'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':
['error', { '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': 'error',
'@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': ['error', 'never'],
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
}
9 changes: 9 additions & 0 deletions .github/linters/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.json",
"compilerOptions": {
"noEmit": true
},
"include": ["../../__tests__/**/*", "../../src/**/*"],
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"]
}
6 changes: 3 additions & 3 deletions __tests__/debug.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export const quick = false // change to true for quicker local testing

if (!quick) {
test('checkout repo', async () => {
const dir = 'gh-action-test-2';
const dir = 'gh-action-test-2'
await deleteIfExists(dir)
fs.mkdirSync(dir);
fs.writeFileSync(`${dir}/conflict`, 'File that makes directory not empty\n');
fs.mkdirSync(dir)
fs.writeFileSync(`${dir}/conflict`, 'File that makes directory not empty\n')
await expect(clone('master', dir)).rejects.toThrow(
`fatal: destination path '${dir}' already exists and is not an empty directory.`
)
Expand Down
89 changes: 0 additions & 89 deletions eslint.config.mjs

This file was deleted.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "npx tsc",
"format": "prettier --write 'src/**/*.ts'",
"format-check": "prettier --check 'src/**/*.ts'",
"lint": "eslint src/**/*.ts",
"lint": "npx eslint . -c ./.github/linters/.eslintrc.yml",
"package": "ncc build --source-map --license licenses.txt",
"test": "jest --runInBand",
"all": "yarn run build && yarn run format && yarn run lint && yarn run package && yarn test"
Expand All @@ -28,17 +28,21 @@
"@actions/core": "^1.10.1"
},
"devDependencies": {
"@types/node": "^20.14.9",
"@types/rimraf": "^4.0.5",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.8",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^9.5.0",
"eslint": "^8.57.0",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"js-yaml": "^4.1.0",
"make-coverage-badge": "^1.2.0",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"prettier-eslint": "^16.3.0",
"ts-jest": "^29.1.5",
"typescript": "^5.5.2",
"yarn": "^1.22.22"
Expand Down
Loading

0 comments on commit 6da9414

Please sign in to comment.