Skip to content

Commit 66d1b3f

Browse files
authored
Merge pull request #2162 from cjihrig/linter
deps: replace tslint with typescript-eslint
2 parents f03fd65 + 5567d6a commit 66d1b3f

29 files changed

+2000
-929
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ k8sApi.createNamespace(namespace).then(
6666
```
6767

6868
## Create a cluster configuration programatically
69+
6970
```javascript
7071
const k8s = require('@kubernetes/client-node');
7172

@@ -114,28 +115,29 @@ release, we will increment the minor version whenever we update the minor Kubern
114115
Generally speaking newer clients will work with older Kubernetes, but compatability isn't 100% guaranteed.
115116

116117
| client version | older versions | 1.18 | 1.19 | 1.20 | 1.21 | 1.22 |
117-
|----------------|----------------|------|------|------|------|------|
118-
| 0.12.x | - | | x | x | x | x |
119-
| 0.13.x | - | + | | x | x | x |
120-
| 0.14.x | - | + | + | | x | x |
121-
| 0.15.x | - | + | + | + | | x |
122-
| 0.16.x | - | + | + | + | + | |
118+
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- |
119+
| 0.12.x | - | | x | x | x | x |
120+
| 0.13.x | - | + | | x | x | x |
121+
| 0.14.x | - | + | + | | x | x |
122+
| 0.15.x | - | + | + | + | | x |
123+
| 0.16.x | - | + | + | + | + | |
123124

124125
Key:
125126

126-
* `` Exactly the same features / API objects in both javascript-client and the Kubernetes
127+
- `` Exactly the same features / API objects in both javascript-client and the Kubernetes
127128
version.
128-
* `+` javascript-client has features or api objects that may not be present in the
129+
- `+` javascript-client has features or api objects that may not be present in the
129130
Kubernetes cluster, but everything they have in common will work.
130-
* `-` The Kubernetes cluster has features the javascript-client library can't use
131+
- `-` The Kubernetes cluster has features the javascript-client library can't use
131132
(additional API objects, etc).
132-
* `x` The Kubernetes cluster has no guarantees to support the API client of
133+
- `x` The Kubernetes cluster has no guarantees to support the API client of
133134
this version, as it only promises _n_-2 version support. It is not tested,
134135
and operations using API versions that have been deprecated and removed in
135136
later server versions won't function correctly.
136137

137138
# Known Issues
138-
* Multiple kubeconfigs are not completely supported.
139+
140+
- Multiple kubeconfigs are not completely supported.
139141
Credentials are cached based on the kubeconfig username and these can collide across configs.
140142
Here is the related [issue](https://github.com/kubernetes-client/javascript/issues/592).
141143

@@ -171,7 +173,7 @@ Run `npm run format` or install an editor plugin like https://github.com/prettie
171173

172174
## Linting
173175

174-
Run `npm run lint` or install an editor plugin like https://github.com/Microsoft/vscode-typescript-tslint-plugin
176+
Run `npm run lint` or install an editor plugin.
175177

176178
# Testing
177179

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
4+
export default tseslint.config(
5+
{
6+
ignores: ['dist/', 'docs/', 'node_modules/', 'src/gen/'],
7+
},
8+
eslint.configs.recommended,
9+
tseslint.configs.strict,
10+
{
11+
languageOptions: {
12+
globals: {
13+
Buffer: true,
14+
console: true,
15+
process: true,
16+
setTimeout: true,
17+
},
18+
},
19+
rules: {
20+
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': false }],
21+
'@typescript-eslint/no-empty-object-type': 'off',
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'@typescript-eslint/no-non-null-assertion': 'off',
24+
'@typescript-eslint/no-unused-expressions': 'off',
25+
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
26+
},
27+
},
28+
);

examples/typescript/simple/example.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ const res = await k8sApi.listNamespacedPod({ namespace });
1111
console.log(res);
1212

1313
// Example of instantiating a Pod object.
14+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1415
const pod = {} as k8s.V1Pod;

examples/typescript/tslint.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)