Skip to content

Commit 360be27

Browse files
committed
Add eslint config to prevent introduction of non-erasable changes
1 parent ff8ec79 commit 360be27

File tree

5 files changed

+57
-5
lines changed

5 files changed

+57
-5
lines changed

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import eslint from '@eslint/js';
2+
import erasableSyntaxOnly from 'eslint-plugin-erasable-syntax-only';
23
import tseslint from 'typescript-eslint';
34

45
export default tseslint.config(
56
{
67
ignores: ['dist/', 'docs/', 'node_modules/', 'src/gen/'],
78
},
89
eslint.configs.recommended,
10+
erasableSyntaxOnly.configs.recommended,
911
tseslint.configs.strict,
1012
{
1113
languageOptions: {

package-lock.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"@types/mock-fs": "^4.13.1",
8181
"c8": "^10.0.0",
8282
"eslint": "^9.18.0",
83+
"eslint-plugin-erasable-syntax-only": "^0.3.0",
8384
"husky": "^9.0.6",
8485
"mocha": "^11.0.1",
8586
"mock-fs": "^5.2.0",

src/object_test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ describe('KubernetesObject', () => {
3636
});
3737

3838
class KubernetesObjectApiTest extends KubernetesObjectApi {
39-
constructor(public configuration: Configuration) {
39+
public configuration: Configuration;
40+
public constructor(configuration: Configuration) {
4041
super(configuration);
42+
this.configuration = configuration;
4143
}
4244

4345
public static makeApiClient(kc?: KubeConfig): KubernetesObjectApiTest {

src/test/match-buffer.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ export function matchBuffer(channel: number, contents: string): StringBufferMatc
77
}
88

99
class StringBufferMatcher extends Matcher {
10-
constructor(
11-
private channel: number,
12-
private contents: string,
13-
) {
10+
private channel: number;
11+
private contents: string;
12+
constructor(channel: number, contents: string) {
1413
super();
14+
this.channel = channel;
15+
this.contents = contents;
1516
}
1617

1718
public valueOf(): string {

0 commit comments

Comments
 (0)