Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
import tsPlugin from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'

export default [{
files: ['**/*.ts']
}, {
plugins: {
'@typescript-eslint': tsPlugin
},
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: 'module'
},
rules: {
'@typescript-eslint/naming-convention': ['warn', {
selector: 'import',
format: ['camelCase', 'PascalCase']
}],
'curly': 'warn',
'eqeqeq': 'warn',
'no-throw-literal': 'warn',
'semi': 'off',
'quotes': ['error', 'single']
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
{
rules: {
'curly': 'error',
'eol-last': ['error', 'always'],
'eqeqeq': 'error',
'no-throw-literal': 'error',
'quotes': ['error', 'single'],
'semi': ["error", "never"],
'@typescript-eslint/naming-convention': ['warn', {
selector: 'import',
format: ['camelCase', 'PascalCase']
}]
}
}
}]
)
115 changes: 69 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
"simple-git": "^3.27.0"
},
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/node": "20.x",
"@types/vscode": "^1.96.0",
"@typescript-eslint/eslint-plugin": "^8.17.0",
"@typescript-eslint/parser": "^8.17.0",
"eslint": "^9.16.0",
"eslint": "^9.17.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"typescript": "^5.7.2"
"typescript": "^5.7.2",
"typescript-eslint": "^8.19.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/GitFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class GitFacade {
}

async hasStagedFiles(): Promise<boolean> {
const diff = await this.git.diff(['--name-only', '--cached']);
const diff = await this.git.diff(['--name-only', '--cached'])
return (diff.trim() !== '')
}

Expand Down Expand Up @@ -51,7 +51,7 @@ export class GitFacade {
async getCommitsNotInUpstream(): Promise<readonly Commit[] | typeof NO_UPSTREAM> {
try {
return (await this.queryCommits('@{u}..'))
} catch (e: any) {
} catch (e) {
if (e.message?.includes('no upstream configured')) {
return NO_UPSTREAM
}
Expand Down Expand Up @@ -85,7 +85,7 @@ export class GitFacade {
GIT_SEQUENCE_EDITOR: 'true' // bypass the interactive editor
}).rebase(['--autosquash', '--autostash', '-i', `${hash}~`])
return false
} catch (e: any) {
} catch (e) {
if (e.message?.includes('Merge conflict')) {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const activate = (context: vscode.ExtensionContext): void => {
writeToOutputChannel(successMessage)
vscode.window.showInformationMessage(successMessage)
}
} catch (error: any) {
} catch (error) {
vscode.window.showErrorMessage(error.message)
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export type BranchName = string
export interface Commit {
hash: ShortCommitHash
subject: string
}
}
2 changes: 1 addition & 1 deletion test/GitFacade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ describe('GitFacade', () => {
await git.commit('-')
expect(await facade.hasStagedFiles()).toBe(false)
})
})
})
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUnusedParameters": true
"noUnusedParameters": true,
"useUnknownInCatchVariables": false
},
"exclude": ["test/*"]
}
Loading