New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stylelint-no-unresolved-module

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-no-unresolved-module

Ensures that module (import-like or `url`) can be resolved to a module on the file system.

  • 2.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

stylelint-no-unresolved-module

Build Status

Ensures that module (import-like or url) can be resolved to a module on the file system.

Nodes which are considered "modules":

Features:

Install

npm install stylelint-no-unresolved-module --save

Usage

Add this config to your .stylelintrc:

{
	"plugins": ["stylelint-no-unresolved-module"],
	"rules": {
		"plugin/no-unresolved-module": {
			"alias": {
				"assets": "pebbles"
			},
			"modules": ["node_modules", "local_modules"]
		}
	}
}

Assuming file system like this:

.
├── package.json
├── index.css
├── milo/
│   └── macy.css
├── node_modules/
│   └── josie/
│       ├── package.json
│       ├── rusty.css
│       └── index.css
└── local_modules/
    ├── pebbles/
    │   └── tucker.png
    └── shelby/
        └── shelby.css

Assuming code is run from ./index.css:

/**
 * These resources can be resolved */

@import url('josie');
@import url('shelby/shelby.css');
@import url('./milo/macy.css');

body {
	background: url('assets/tucker.jpg');
}

/**
 * These resources can’t be resolved */

@import url('shelby');
@import url('josie/misty.css');
@import url('./milo/index.css');

body {
	background: url('assets/sandy.jpg');
}

Options

Plugin accepts either boolean (true) or object configuration.

If boolean, it will use default configuration:

  • No aliases
  • Look only inside node_modules for non-relative resource paths

If object configuration, following properties are valid:

cwd

Type: string
Default: process.cwd()

Root directory from where to start resolving resources. If it’s not defined, directory of file will be used. Useful for situations where you don’t have original file.

alias

Type: Object

A list of module alias configurations or an object which maps key to value. See original documentation.

modules

Type: string[]

A list of directories to resolve modules from. See original documentation.

roots

Type: string[]

A list of root paths. See original documentation.

License

MIT © Ivan Nikolić

Keywords

FAQs

Package last updated on 23 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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