Skip to content

Commit

Permalink
Merge pull request #2162 from cjihrig/linter
Browse files Browse the repository at this point in the history
deps: replace tslint with typescript-eslint
  • Loading branch information
k8s-ci-robot authored Jan 16, 2025
2 parents f03fd65 + 5567d6a commit 66d1b3f
Show file tree
Hide file tree
Showing 29 changed files with 2,000 additions and 929 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ k8sApi.createNamespace(namespace).then(
```

## Create a cluster configuration programatically

```javascript
const k8s = require('@kubernetes/client-node');

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

| client version | older versions | 1.18 | 1.19 | 1.20 | 1.21 | 1.22 |
|----------------|----------------|------|------|------|------|------|
| 0.12.x | - | | x | x | x | x |
| 0.13.x | - | + | | x | x | x |
| 0.14.x | - | + | + | | x | x |
| 0.15.x | - | + | + | + | | x |
| 0.16.x | - | + | + | + | + | |
| -------------- | -------------- | ---- | ---- | ---- | ---- | ---- |
| 0.12.x | - | | x | x | x | x |
| 0.13.x | - | + | | x | x | x |
| 0.14.x | - | + | + | | x | x |
| 0.15.x | - | + | + | + | | x |
| 0.16.x | - | + | + | + | + | |

Key:

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

# Known Issues
* Multiple kubeconfigs are not completely supported.

- Multiple kubeconfigs are not completely supported.
Credentials are cached based on the kubeconfig username and these can collide across configs.
Here is the related [issue](https://github.com/kubernetes-client/javascript/issues/592).

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

## Linting

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

# Testing

Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['dist/', 'docs/', 'node_modules/', 'src/gen/'],
},
eslint.configs.recommended,
tseslint.configs.strict,
{
languageOptions: {
globals: {
Buffer: true,
console: true,
process: true,
setTimeout: true,
},
},
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': false }],
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
},
},
);
1 change: 1 addition & 0 deletions examples/typescript/simple/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const res = await k8sApi.listNamespacedPod({ namespace });
console.log(res);

// Example of instantiating a Pod object.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const pod = {} as k8s.V1Pod;
6 changes: 0 additions & 6 deletions examples/typescript/tslint.json

This file was deleted.

Loading

0 comments on commit 66d1b3f

Please sign in to comment.