Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
cspell-grammar
Advanced tools
cspell-grammar
CSpell Grammar is used to generate a parser. The Parser is used to add context / scope to parts of a document, making it easier to define the parts to spell spell checked.
This is to address the issues and limitations related to ignoreRegExpList
and includeRegExpList
.
The parser is use to add scope
to sections of a document. The scope
can then be used to apply spell checking rules.
Example: Only check comments and strings
rules:
'*': false
comment: true
string: true
It can be even more powerful like controlling the language settings based upon scope.
rules:
comment:
language: en
string:
language: en,fr
dictionaries: ['marketing-terms'],
caseSensitive: true
string.javascript:
caseSensitive: false
Rules are applied in the order they match the scope of the text.
When checking JavaScript files with the above example rules:
en,fr
marketing-terms
dictionary will be enabledcaseSensitive
will be true
en
caseSensitive
will be false
At its core, cspell-grammar
uses a simplified form of the TextMate grammar.
Why use a grammar parser? Couldn't a colorizer / highlighter or a language AST be used? At one level, needs of the spell checker are simpler and different from colorizers or language AST parsers. The goal of a spell checker is to spell check relevant text. The spell check does not need to care about the syntactical correctness of a document or presentation.
The goal of a grammar parser for the spell checker is to allow the user to decide:
Note: CSpell is a pure JavaScript application, so including the Oniguruma is not an option.
Consider the following bit of LaTeX:
k\"{o}nnen
können
For the spell checker to work correctly, the \"{o}
should be transformed into ö
before it is checked against the German dictionary.
This creates a few challenges.
Possible options:
FAQs
Grammar parsing support for cspell
The npm package cspell-grammar receives a total of 619,783 weekly downloads. As such, cspell-grammar popularity was classified as popular.
We found that cspell-grammar demonstrated a healthy version release cadence and project activity because the last version was released less than 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.