Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@emmetio/config
Advanced tools
This module provides resolver for config that can be passed to Emmet abbreviation expander as options
argument. The config may contain global, syntax- and project-specific preferences like output format or snippets and config resolver creates final options payload with proper preferences overrides.
Config is a JSON file that contains global, syntax- and projects specific preferences. Currently, Emmet distinct two types of abbreviations: markup
(for languages like HTML, XML, Slim etc.) and stylesheet
(CSS, SASS, Less etc.), each of them has different settings and usage semantics. In order to globally configure all markup and/or stylesheet abbreviations, use globals
key with markup
and stylesheet
subkeys accordingly:
{
"globals": {
"markup": {
"profile": {
// Output all tags in uppercase
"tagCase": "upper"
},
// Add custom snippets to all markup-based syntaxes
"snippets": {
"site-nav": "nav>ul.nav>li.nav-item"
}
},
"stylesheet": {
// Add custom snippets to all stylesheet-based syntaxes
"snippets": {
"black": "color: black"
}
}
}
}
For available options, see types.d.ts
file.
Sometimes you may want to add syntax-specific preferences. For example, you may want to customize SASS syntax with new snippets but don’t want to use them in CSS. In this case, you should use syntax
key and a syntax name as a subkey:
{
"syntax": {
"sass": {
// In syntax-specific config, `type` must be either "markup" or "stylesheet"
"type": "stylesheet",
"snippets": {
"inc": "@include"
}
}
}
}
Contents of syntax-specific config is the same as global config.
You may also want to configure Emmet specifically for a project. Use "project" top-level key with project ID as a subkey:
{
"project": {
"my-project1": {
// Use `globals` and `syntax` sections as described above
"globals": { ... },
"syntax": { ... }
}
}
}
Config resolver is a function that takes JSON config and params that identify current context: abbreviation type, syntax and project.
import { expand } from '@emmetio/expand-abbreviation';
import resolveConfig from '@emmetio/config';
// Obtain config JSON somehow
const config = readFile('emmet-config.json');
// Identify current context
const params = {
type: 'markup',
syntax: 'html',
project: 'my-project1'
};
const result = expand('ul>li', resolveConfig(config, params));
console.log(result);
Available context options:
type
: type of abbreviation, either markup
or stylesheet
.syntax
: syntax name, a subkey of syntax
section.project
: ID of project, a subkey of project
section.Config resolver will create a final options payload for abbreviation expander, depending on context params.
FAQs
Emmet config resolver
We found that @emmetio/config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.