eslint-plugin-no-excess-properties 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierignore +1 -0
- package/README.md +76 -76
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/eslint.config.mjs +3 -2
- package/package.json +9 -8
- package/src/index.ts +1 -1
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
package-lock.json
|
package/README.md
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
# eslint-plugin-no-excess-properties
|
|
2
|
-
|
|
3
|
-
ESLint plugin for TypeScript that warns when there are excess properties on object literals
|
|
4
|
-
|
|
5
|
-
Currently has a single rule `no-excess-properties/object-literal` that uses [typed linting](https://typescript-eslint.io/getting-started/typed-linting)
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
npm install --save-dev eslint-plugin-no-excess-properties
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Config
|
|
14
|
-
|
|
15
|
-
In the `eslint.config.mjs` file:
|
|
16
|
-
|
|
17
|
-
### Basic
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
import
|
|
21
|
-
import noExcessProperties from "eslint-plugin-no-excess-properties";
|
|
22
|
-
|
|
23
|
-
export default
|
|
24
|
-
extends: [
|
|
25
|
-
noExcessProperties.configs.recommended,
|
|
26
|
-
],
|
|
27
|
-
})
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Fancy
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
import
|
|
34
|
-
import noExcessProperties from "eslint-plugin-no-excess-properties";
|
|
35
|
-
|
|
36
|
-
export default
|
|
37
|
-
plugins: {
|
|
38
|
-
"no-excess-properties": noExcessProperties,
|
|
39
|
-
},
|
|
40
|
-
rules: {
|
|
41
|
-
"no-excess-properties/object-literal": "error",
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Example Linted Code
|
|
47
|
-
|
|
48
|
-
See the [test file](https://github.com/unimorphic/eslint-plugin-no-excess-properties/blob/master/src/object-literal.test.ts) for more examples
|
|
49
|
-
|
|
50
|
-
### Incorrect
|
|
51
|
-
|
|
52
|
-
```
|
|
53
|
-
let test1: { prop1: number; } = { prop1: 1 };
|
|
54
|
-
const test2 = { prop1: 2, extraPropertyNotInTest1: 3 };
|
|
55
|
-
test1 = test2; // Error
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Correct
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
let test1: { prop1: number; } = { prop1: 1 };
|
|
62
|
-
const test2 = { prop1: 2 };
|
|
63
|
-
test1 = test2; // OK
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## More Info
|
|
67
|
-
|
|
68
|
-
Related typescript-eslint issue: https://github.com/typescript-eslint/typescript-eslint/issues/10234
|
|
69
|
-
|
|
70
|
-
## Feedback
|
|
71
|
-
|
|
72
|
-
[Submit](https://github.com/unimorphic/eslint-plugin-no-excess-properties/issues/new) bug reports and other feedback in the [issues](https://github.com/unimorphic/eslint-plugin-no-excess-properties/issues) section
|
|
73
|
-
|
|
74
|
-
## License
|
|
75
|
-
|
|
76
|
-
MIT
|
|
1
|
+
# eslint-plugin-no-excess-properties
|
|
2
|
+
|
|
3
|
+
ESLint plugin for TypeScript that warns when there are excess properties on object literals
|
|
4
|
+
|
|
5
|
+
Currently has a single rule `no-excess-properties/object-literal` that uses [typed linting](https://typescript-eslint.io/getting-started/typed-linting)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install --save-dev eslint-plugin-no-excess-properties
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Config
|
|
14
|
+
|
|
15
|
+
In the `eslint.config.mjs` file:
|
|
16
|
+
|
|
17
|
+
### Basic
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
import { defineConfig } from "eslint/config";
|
|
21
|
+
import noExcessProperties from "eslint-plugin-no-excess-properties";
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
extends: [
|
|
25
|
+
noExcessProperties.configs.recommended,
|
|
26
|
+
],
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Fancy
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
import { defineConfig } from "eslint/config";
|
|
34
|
+
import noExcessProperties from "eslint-plugin-no-excess-properties";
|
|
35
|
+
|
|
36
|
+
export default defineConfig({
|
|
37
|
+
plugins: {
|
|
38
|
+
"no-excess-properties": noExcessProperties,
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
"no-excess-properties/object-literal": "error",
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Example Linted Code
|
|
47
|
+
|
|
48
|
+
See the [test file](https://github.com/unimorphic/eslint-plugin-no-excess-properties/blob/master/src/object-literal.test.ts) for more examples
|
|
49
|
+
|
|
50
|
+
### Incorrect
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
let test1: { prop1: number; } = { prop1: 1 };
|
|
54
|
+
const test2 = { prop1: 2, extraPropertyNotInTest1: 3 };
|
|
55
|
+
test1 = test2; // Error
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Correct
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
let test1: { prop1: number; } = { prop1: 1 };
|
|
62
|
+
const test2 = { prop1: 2 };
|
|
63
|
+
test1 = test2; // OK
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## More Info
|
|
67
|
+
|
|
68
|
+
Related typescript-eslint issue: https://github.com/typescript-eslint/typescript-eslint/issues/10234
|
|
69
|
+
|
|
70
|
+
## Feedback
|
|
71
|
+
|
|
72
|
+
[Submit](https://github.com/unimorphic/eslint-plugin-no-excess-properties/issues/new) bug reports and other feedback in the [issues](https://github.com/unimorphic/eslint-plugin-no-excess-properties/issues) section
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,4CAAoB;AACpB,sEAA6C;AAE7C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAG/D,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,OAAO,EAAE;QACP,IAAI,WAAW;YACb,OAAO;gBACL,OAAO,EAAE;oBACP,sBAAsB,EAAE,MAAM;iBAC/B;gBACD,KAAK,EAAE;oBACL,qCAAqC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,4CAAoB;AACpB,sEAA6C;AAE7C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAG/D,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,OAAO,EAAE;QACP,IAAI,WAAW;YACb,OAAO;gBACL,OAAO,EAAE;oBACP,sBAAsB,EAAE,MAAM;iBAC/B;gBACD,KAAK,EAAE;oBACL,qCAAqC,EAAE,MAAM;iBACrC;aACX,CAAC;QACJ,CAAC;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB;IACD,KAAK,EAAE;QACL,gBAAgB,EAAE,wBAAa;KAChC;CACF,CAAC;AAEF,iBAAS,MAAM,CAAC"}
|
package/eslint.config.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import eslint from "@eslint/js";
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
import eslintPlugin from "eslint-plugin-eslint-plugin";
|
|
4
|
+
import { defineConfig } from "eslint/config";
|
|
4
5
|
|
|
5
|
-
export default
|
|
6
|
+
export default defineConfig({
|
|
6
7
|
extends: [
|
|
7
8
|
eslint.configs.recommended,
|
|
8
|
-
eslintPlugin.configs
|
|
9
|
+
eslintPlugin.configs.recommended,
|
|
9
10
|
tseslint.configs.strictTypeChecked,
|
|
10
11
|
tseslint.configs.stylisticTypeChecked,
|
|
11
12
|
],
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "eslint-plugin-no-excess-properties",
|
|
3
3
|
"description": "Excess properties are not allowed on object literals",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.2",
|
|
6
6
|
"homepage": "https://github.com/unimorphic/eslint-plugin-no-excess-properties",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint-plugin",
|
|
@@ -29,20 +29,21 @@
|
|
|
29
29
|
"test": "vitest"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@typescript-eslint/utils": "8.
|
|
32
|
+
"@typescript-eslint/utils": "8.46.4",
|
|
33
|
+
"ts-api-utils": "2.1.0"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
36
|
+
"@eslint/js": ">=9.0.0",
|
|
35
37
|
"@typescript-eslint/parser": ">=8.0.0",
|
|
36
38
|
"eslint": ">=9.0.0",
|
|
37
39
|
"typescript": ">=5.0.0"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"eslint-plugin-eslint-plugin": "6.5.0",
|
|
42
|
+
"@types/node": "24.10.1",
|
|
43
|
+
"@typescript-eslint/rule-tester": "8.46.4",
|
|
44
|
+
"eslint-plugin-eslint-plugin": "7.2.0",
|
|
44
45
|
"prettier": "3.6.2",
|
|
45
|
-
"typescript-eslint": "8.
|
|
46
|
-
"vitest": "
|
|
46
|
+
"typescript-eslint": "8.46.4",
|
|
47
|
+
"vitest": "4.0.9"
|
|
47
48
|
}
|
|
48
49
|
}
|