Giter Site home page Giter Site logo

lint-roller's Introduction

@electron/lint-roller

CircleCI npm version

Markdown linting helpers for Electron org repos

Usage

yarn global add @electron/lint-roller

electron-markdownlint "**/*.md"
electron-lint-markdown-links --root docs/ "docs/**/*.md"

What It Provides

A base config for markdownlint is provided for consistent linting rules across repos. To use the base config, extend it in .markdownlint.json:

{
  "extends": "@electron/lint-roller/configs/markdownlint.json"
}

electron-markdownlint is provided as a wrapper command which adds extra rules found in this package automatically.

electron-lint-markdown-links is a command to further lint links to find broken relative links, including URL fragments, and can also be used to check external links with the --fetch-external-links option.

electron-lint-markdown-standard is a command to lint JS code blocks in Markdown with standard, like standard-markdown does, but with better detection of code blocks. Linting can be disabled for specific code blocks by adding @nolint to the info string.

electron-lint-markdown-ts-check is a command to type check JS/TS code blocks in Markdown with tsc. Type checking can be disabled for specific code blocks by adding @ts-nocheck to the info string, specific lines can be ignored by adding @ts-ignore=[<line1>,<line2>] to the info string, and additional globals can be defined with @ts-type={name:type}. The Window object can be extended with more types using @ts-window-type={name:type}. When type checking TypeScript blocks in the same Markdown file, global augmentation (via declare global) can be shared between code blocks by putting @ts-noisolate on the code block doing the global augmentation.

License

MIT

lint-roller's People

Contributors

dependabot[bot] avatar dsanders11 avatar electron-roller[bot] avatar itsananderson avatar marshallofsound avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lint-roller's Issues

Type Check Code Blocks in Markdown

In addition to linting with standard, more mistakes in Markdown code blocks would be caught if some type checking was done (e.g. tsc --noEmit --checkJs). This could be opt-out using a flag in the info string for the code block, such as @ts-nocheck. Some extra magic could also be added to check for a require of electron, and if there isn't one, inject a generic one with default imports (app, BrowserWindow, etc).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.