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

firescript-linter

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firescript-linter - npm Package Compare versions

Comparing version 0.9.0 to 0.10.0

2

package.json
{
"name": "firescript-linter",
"version": "0.9.0",
"version": "0.10.0",
"description": "Linter for Firescript",

@@ -5,0 +5,0 @@ "main": "app.js",

@@ -5,2 +5,4 @@ const path = require('path')

const fileExtensions = ['', '.fire']
class ImportDeclaration extends LinterNode {

@@ -11,4 +13,8 @@ lint (ast) {

if (ast.source.value.charAt(0) === '.') {
const modulePath = path.resolve(path.dirname(this.session.filename), ast.source.value)
if (!this.moduleExists(modulePath)) {
const moduleFound = fileExtensions.some((ext) => {
const modulePath = path.resolve(path.dirname(this.session.filename), `${ast.source.value}${ext}`)
return this.moduleExists(modulePath)
})
if (!moduleFound) {
this.lintException(new ModuleNotFound(ast.source, ast.source.value))

@@ -34,3 +40,4 @@ }

try {
require.resolve(modulePath)
const paths = this.getRequirePaths()
require.resolve(modulePath, paths)
return true

@@ -45,4 +52,18 @@ } catch (err) {

}
getRequirePaths () {
const paths = []
const pathsplit = this.session.filename.split('/')
while (pathsplit.pop()) {
const p = pathsplit.join('/')
paths.push(`${p}/node_modules`)
}
paths.push(`${process.env.HOME}/.node_modules`)
paths.push(`${process.env.HOME}/.node_libraries`)
return paths
}
}
module.exports.ImportDeclaration = ImportDeclaration

@@ -24,2 +24,4 @@ const { LinterNode } = require('../LinterNode')

}
} else if (!ast.init) {
this.debug('Rule: disallow empty let statements')
} else {

@@ -26,0 +28,0 @@ this.lintNode(ast.init)

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