Skip to content

Add eslint config to prevent introduction of non-erasable changes #2303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025
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
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import eslint from '@eslint/js';
import erasableSyntaxOnly from 'eslint-plugin-erasable-syntax-only';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['dist/', 'docs/', 'node_modules/', 'src/gen/'],
},
eslint.configs.recommended,
erasableSyntaxOnly.configs.recommended,
tseslint.configs.strict,
{
languageOptions: {
Expand Down
46 changes: 46 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"@types/mock-fs": "^4.13.1",
"c8": "^10.0.0",
"eslint": "^9.18.0",
"eslint-plugin-erasable-syntax-only": "^0.3.0",
"husky": "^9.0.6",
"mocha": "^11.0.1",
"mock-fs": "^5.2.0",
Expand Down
4 changes: 3 additions & 1 deletion src/object_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ describe('KubernetesObject', () => {
});

class KubernetesObjectApiTest extends KubernetesObjectApi {
constructor(public configuration: Configuration) {
public configuration: Configuration;
public constructor(configuration: Configuration) {
super(configuration);
this.configuration = configuration;
}

public static makeApiClient(kc?: KubeConfig): KubernetesObjectApiTest {
Expand Down
9 changes: 5 additions & 4 deletions src/test/match-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export function matchBuffer(channel: number, contents: string): StringBufferMatc
}

class StringBufferMatcher extends Matcher {
constructor(
private channel: number,
private contents: string,
) {
private channel: number;
private contents: string;
constructor(channel: number, contents: string) {
super();
this.channel = channel;
this.contents = contents;
}

public valueOf(): string {
Expand Down