Convert Figma logo to code with AI

streetsidesoftware logocspell

A Spell Checker for Code!

1,209
92
1,209
92

Top Related Projects

2,472

Source code spell checker

4,388

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.

4,798

Catch insensitive, inconsiderate writing

Quick Overview

CSpell is a spell checker for code, designed to catch common misspellings while ignoring code syntax and structure. It supports multiple programming languages and can be integrated into various development environments and workflows, making it an essential tool for maintaining clean and professional code.

Pros

  • Supports a wide range of programming languages and file types
  • Easily customizable with user-defined dictionaries and settings
  • Integrates well with popular code editors and CI/CD pipelines
  • Actively maintained and regularly updated

Cons

  • May produce false positives for domain-specific terminology
  • Configuration can be complex for advanced use cases
  • Performance may slow down with very large codebases
  • Limited support for non-English languages

Code Examples

  1. Basic usage in a Node.js script:
const { CSpell } = require('cspell');

const text = 'This is a smple exmple with misspelled wrds.';
const cspell = new CSpell();

cspell.checkText(text).then(issues => {
  console.log(issues);
});
  1. Using CSpell with custom dictionary:
const { CSpell } = require('cspell');

const customDictionary = ['customword1', 'customword2'];
const cspell = new CSpell({
  dictionaries: ['en_US', { name: 'custom', words: customDictionary }]
});

cspell.checkText('This is a customword1 in the text.').then(issues => {
  console.log(issues);
});
  1. Checking a file:
const { CSpell } = require('cspell');
const fs = require('fs');

const cspell = new CSpell();
const fileContent = fs.readFileSync('path/to/file.txt', 'utf8');

cspell.checkText(fileContent, 'path/to/file.txt').then(issues => {
  console.log(issues);
});

Getting Started

To use CSpell in your project, follow these steps:

  1. Install CSpell:
npm install cspell
  1. Create a configuration file (cspell.json) in your project root:
{
  "version": "0.2",
  "language": "en",
  "words": [],
  "flagWords": [],
  "ignorePaths": []
}
  1. Run CSpell on your project:
npx cspell "**/*.{js,ts,html,css}"

This will check all JavaScript, TypeScript, HTML, and CSS files in your project for spelling errors.

Competitor Comparisons

2,472

Source code spell checker

Pros of typos

  • Written in Rust, offering better performance and memory safety
  • Supports multiple file formats beyond just code (e.g., Markdown, LaTeX)
  • Provides a simple, straightforward CLI interface

Cons of typos

  • Smaller community and ecosystem compared to cspell
  • Less extensive configuration options and customization features
  • Limited integration with IDEs and text editors

Code Comparison

cspell configuration example:

{
  "language": "en",
  "words": ["customword"],
  "ignoreWords": ["ignoredword"],
  "import": ["./custom-dictionary.txt"]
}

typos configuration example:

[default]
extend-ignore-re = [
    "customword",
]
extend-ignore-identifiers-re = [
    "ignoredword",
]

Both tools offer configuration options, but cspell provides more granular control over language settings and dictionary management. typos focuses on a simpler approach with regex-based ignore patterns.

While cspell is more widely adopted and offers extensive integrations, typos excels in performance and supports a broader range of file formats. The choice between the two depends on specific project requirements, team preferences, and the need for customization versus simplicity.

4,388

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.

Pros of Vale

  • More comprehensive linting capabilities, including style, grammar, and consistency checks
  • Highly customizable with support for custom rules and styles
  • Integration with multiple markup formats (Markdown, AsciiDoc, reStructuredText)

Cons of Vale

  • Steeper learning curve due to more complex configuration
  • Potentially slower performance for large documents compared to CSpell
  • Requires more setup and maintenance for custom rules

Code Comparison

Vale configuration example:

StylesPath = styles
MinAlertLevel = suggestion

[*.md]
BasedOnStyles = Vale, proselint

CSpell configuration example:

{
  "version": "0.2",
  "language": "en",
  "words": ["customword", "anotherword"],
  "ignoreWords": ["ignoredword"]
}

Both tools offer configuration options, but Vale's configuration is more extensive and allows for more fine-grained control over linting rules and styles. CSpell's configuration is simpler and primarily focused on managing custom dictionaries and ignored words.

4,798

Catch insensitive, inconsiderate writing

Pros of Alex

  • Focuses on inclusive and non-offensive language, promoting better communication
  • Integrates well with various text editors and CI/CD pipelines
  • Provides explanations for flagged issues, helping users understand and learn

Cons of Alex

  • More limited in scope compared to CSpell's general spell-checking capabilities
  • May have a higher rate of false positives due to context-sensitive nature of language
  • Requires more manual configuration for project-specific terminology

Code Comparison

Alex usage:

const alex = require('alex');
const report = alex('He\'s very talented.');
console.log(report);

CSpell usage:

const cspell = require('cspell');
const result = cspell.spellFile('document.txt');
console.log(result);

Both tools can be integrated into various workflows and offer CLI usage. Alex focuses on identifying potentially insensitive language, while CSpell provides broader spell-checking functionality. Alex may be more suitable for content-heavy projects where inclusive language is a priority, whereas CSpell excels in catching general spelling errors across various file types, making it more versatile for code-centric projects.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CSpell

unit tests integration tests lint coverage

codecov Coverage Status

The CSpell mono-repo, a spell checker for code.

Support Future Development

  • GitHub Sponsors
  • Patreon
  • PayPal
  • Open Collective

Documentation

Documentation - CSpell

Third-Party Video Presentations

Some videos related to CSpell and the Code Spell Checker for VS Code.

Packages

Related Packages

  • cspell-cli -- cspell-cli is useful for including cspell directly from GitHub.

    Example install: npm install -g git+https://github.com/streetsidesoftware/cspell-cli.

    This will add the cspell-cli command, which is an alias of the cspell command.

Live Discussions

Join us on:

cspell.zulipchat.com

RFCs

LinkDescriptionStatus
rfc-0001Fixing common misspellingsDone
rfc-0002Improving Generated SuggestionsDone
rfc-0003Plug-ins: Adding file parsersIn Progress
rfc-0004Support Marking Issues as KnownNot started

CSpell for enterprise

Available as part of the Tidelift Subscription.

The maintainers of CSpell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.

Security contact information

To report a security vulnerability, please email security@streetsidesoftware.com or use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Versions

versionNodeStatusMaintenanceEnd of Free Support
cspell8.x18.xIn Active DevelopmentTBDTBD
cspell7.x16.xMaintenance2023-10-012023-11-07
cspell6.x14.14.xPaid support only12023-04-012023-05-01
cspell5.x12.xPaid support only1-2022-10-01
cspell4.x10.xPaid support only1-2022-05-01

Contributing

Contributions are welcome! See our contribution notes. Note: To add or remove words in a dictionary, visit cspell-dicts.

🙏 Special thanks to all of our amazing contributors! 🥰

Contributor Jason3S Contributor street-side-software-automation[bot] Contributor dependabot[bot] Contributor nschonni Contributor Jason-Rev Contributor amanoji Contributor jrylan Contributor mad-gooze Contributor snyk-bot Contributor zo Contributor dsanders11 Contributor coliff Contributor github-actions[bot] Contributor dakotaJang Contributor bisubus Contributor aimagic Contributor abdusabri Contributor caaatisgood Contributor pzmarzly Contributor naveensrinivasan Contributor matt9ucci Contributor lostintangent Contributor Zamiell Contributor dflock Contributor DenysVuika Contributor ScottRudiger Contributor rivy Contributor rasa Contributor roman-petrov Contributor orta Contributor ollelauribostrom Contributor alexandear Contributor ndelangen Contributor nvuillam Contributor 74th Contributor ssbarnea Contributor regseb Contributor zwaldowski Contributor fisker Contributor hzhu Contributor jonz94 Contributor mrazauskas Contributor wtgtybhertgeghgtwtg Contributor wujekbogdan Contributor siosio34 Contributor ADTC Contributor AlexJameson Contributor AlekSi Contributor alicewriteswrongs Contributor aminya Contributor screendriver Contributor d2s Contributor dimitropoulos Contributor evenstensberg Contributor tribut Contributor HoussemDellai Contributor jmatsuzawa Contributor joshje Contributor kamontat Contributor kenji-miyake Contributor fughilli Contributor Ki-er Contributor Maxim-Mazurok Contributor exhuma



Brought to you byStreet Side Software Logo Street Side Software

Footnotes

  1. Support - Street Side Software 2 3

NPM DownloadsLast 30 Days