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

@opencreek/eslint-plugin-ts

Package Overview
Dependencies
Maintainers
4
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opencreek/eslint-plugin-ts - npm Package Compare versions

Comparing version 0.5.0-canary.20.5942096243.0 to 0.5.0-canary.20.5942334688.0

14

build/lib/rules/require-import-js-extension.js

@@ -11,2 +11,8 @@ "use strict";

const creator = RuleCreator((rule) => rule);
const possibleExtensions = [".js", ".jsx", ".ts", ".tsx"];
function pathExistsWithAnyExtension(file, context) {
return possibleExtensions.some((it) => {
return fs_1.default.existsSync(path_1.default.resolve(path_1.default.dirname(context.getFilename()), file + it));
});
}
exports.default = creator({

@@ -22,3 +28,3 @@ name: "require-import-js-extension",

messages: {
"require-import-js-extension": "No relative imports",
"require-import-js-extension": "Require .js extension",
},

@@ -32,7 +38,7 @@ schema: [],

const source = node.source.value;
if (source.indexOf(".") === -1) {
if (source.indexOf(".") !== -1) {
return;
}
const directFileExist = fs_1.default.existsSync(path_1.default.resolve(path_1.default.dirname(context.getFilename()), source + ".js"));
const indexFileExist = fs_1.default.existsSync(path_1.default.resolve(path_1.default.dirname(context.getFilename()), source + "/index.js"));
const directFileExist = pathExistsWithAnyExtension(source, context);
const indexFileExist = pathExistsWithAnyExtension(source + "/index", context);
context.report({

@@ -39,0 +45,0 @@ node,

{
"name": "@opencreek/eslint-plugin-ts",
"version": "0.5.0-canary.20.5942096243.0",
"version": "0.5.0-canary.20.5942334688.0",
"description": "ESLint plugin for Common TypeScript rules",

@@ -56,3 +56,3 @@ "keywords": [

},
"gitHead": "9112394a9bb2d2a901af19758355bdf703be9a8a"
"gitHead": "0870abf745ae8284e7af0365a2e8232accb76d20"
}

Sorry, the diff of this file is not supported yet

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