Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-expect-type

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-expect-type - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/rules/expect.js

9

dist/index.js
"use strict";
const rules_1 = require("./rules");
const configs = Object.keys(rules_1.rules).reduce((acc, name) => (Object.assign(Object.assign({}, acc), { [`expect-type/${name}`]: 'error' })), {});
module.exports = {
rules: {
rule: rules_1.expectType,
},
rules: rules_1.rules,
configs: {
recommended: {
rules: {
'expect-type/rule': 'error',
},
rules: configs,
},
},
};
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./expectType"));
const expect_1 = require("./expect");
exports.rules = {
[expect_1.name]: expect_1.rule,
};

@@ -7,5 +7,3 @@ "use strict";

function getParserServices(context) {
if (!context.parserServices ||
!context.parserServices.program ||
!context.parserServices.esTreeNodeToTSNodeMap) {
if (!context.parserServices || !context.parserServices.program || !context.parserServices.esTreeNodeToTSNodeMap) {
/**

@@ -12,0 +10,0 @@ * The user needs to have configured "project" in their parserOptions

{
"name": "eslint-plugin-expect-type",
"version": "0.0.3",
"version": "0.0.4",
"description": "ESLint plugin with $ExpectType, $ExpectError and $ExpectTypeSnapshot type assertions",

@@ -9,3 +9,19 @@ "author": {

"main": "dist/index.js",
"files": [
"dist"
],
"license": "Apache-2.0",
"engines": {
"node": ">=10.3.0"
},
"scripts": {
"build": "tsc",
"test": "jest --runInBand",
"format": "prettier \"**/*.{ts,js,json,md}\" --write",
"prepublishOnly": "tsc"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ibezkrovnyi/eslint-plugin-expect-type.git"
},
"keywords": [

@@ -29,29 +45,37 @@ "dtslint",

],
"repository": {
"type": "git",
"url": "git+https://github.com/ibezkrovnyi/eslint-plugin-expect-type.git"
"peerDependencies": {
"eslint": "^5.0.0 || ^6.0.0",
"typescript": ">=3.7.5"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "^2.0.0",
"fs-extra": "^8.1.0",
"typescript": "^3.5.3"
"fs-extra": "^8.1.0"
},
"devDependencies": {
"@types/dedent": "^0.7.0",
"@types/eslint": "^6.1.3",
"@types/estree": "^0.0.42",
"@types/fs-extra": "^8.0.0",
"@types/glob": "^7.1.1",
"@types/jest": "^24.0.15",
"@types/node": "^12.7.2",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"prettier": "^1.18.2",
"tsutils": "^3.17.1"
},
"engines": {
"node": ">=10.3.0"
},
"scripts": {
"build": "tsc",
"prepublishOnly": "tsc"
},
"files": [
"dist"
]
"@typescript-eslint/eslint-plugin": "^2.3.1",
"@typescript-eslint/parser": "^2.3.1",
"babel-eslint": "^10.0.2",
"dedent": "^0.7.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-eslint-plugin": "^2.2.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jest": "^23.4.0",
"eslint-plugin-jsdoc": "^20.0.5",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^24.9.0",
"json-schema": "^0.2.5",
"lint-staged": "^9.5.0",
"prettier": "^1.19.1",
"ts-jest": "^24.3.0",
"tsutils": "^3.17.1",
"typescript": "^3.7.5"
}
}

@@ -74,3 +74,3 @@ # eslint-plugin-expect-type

```ts
// $ExpectTypeSnapshot Foo
// $ExpectTypeSnapshot MyFooSnapshot
const Foo = {

@@ -83,4 +83,7 @@ a: 1,

By running `eslint --fix` the following file will be created in the folder of `foo.test.ts`:
****type-snapshots**/foo.test.ts.snap.json**
```
__type-snapshots__/foo.test.ts.snap.json
```
By running `eslint` snapshot type will be matched with actual type and Error will be emitted in case types don't match.

@@ -87,0 +90,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc