All Projects → sindresorhus → Awesome Lint

sindresorhus / Awesome Lint

Licence: mit
Linter for Awesome lists

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Awesome Lint

Linter
Linter for Dart.
Stars: ✭ 372 (-3.38%)
Mutual labels:  linter, lint
Detekt
Static code analysis for Kotlin
Stars: ✭ 4,169 (+982.86%)
Mutual labels:  linter, lint
pahout
A pair programming partner for writing better PHP. Pahout means PHP mahout 🐘
Stars: ✭ 43 (-88.83%)
Mutual labels:  lint, linter
lint-prepush
Lint committed files on pre-push 🔬
Stars: ✭ 18 (-95.32%)
Mutual labels:  lint, linter
Exakat
The Exakat Engine : smart static analysis for PHP
Stars: ✭ 346 (-10.13%)
Mutual labels:  linter, lint
flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (-77.92%)
Mutual labels:  lint, linter
eslint-config
An ESLint shareable config that I used in my projects
Stars: ✭ 15 (-96.1%)
Mutual labels:  lint, linter
arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (-83.64%)
Mutual labels:  lint, linter
selective
Statically find HTML anti patterns using CSS Selectors
Stars: ✭ 15 (-96.1%)
Mutual labels:  lint, linter
Format.cmake
💅 Stylize your code! Automatic clang-format and cmake-format targets for CMake.
Stars: ✭ 94 (-75.58%)
Mutual labels:  lint, linter
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-95.58%)
Mutual labels:  lint, linter
gandalf-lint
Bad Code Shall Not Pass
Stars: ✭ 29 (-92.47%)
Mutual labels:  lint, linter
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-87.79%)
Mutual labels:  lint, linter
cpplint
Static code checker for C++
Stars: ✭ 1,014 (+163.38%)
Mutual labels:  lint, linter
AutoBindings
Set of annotations that aims to make your Android development experience easier along with lint checks.
Stars: ✭ 15 (-96.1%)
Mutual labels:  lint, linter
ue5-style-guide
An attempt to make Unreal Engine 4 projects more consistent
Stars: ✭ 2,892 (+651.17%)
Mutual labels:  lint, linter
arcanist-linters
A collection of custom Arcanist linters
Stars: ✭ 64 (-83.38%)
Mutual labels:  lint, linter
extra pedantic
Stricter Dart analyzer linter settings and best practices.
Stars: ✭ 28 (-92.73%)
Mutual labels:  lint, linter
JSONCustomLintr
Library to allow creation, running, and reporting of custom lint rules for JSON files
Stars: ✭ 19 (-95.06%)
Mutual labels:  lint, linter
elint
A easy way to lint your code
Stars: ✭ 38 (-90.13%)
Mutual labels:  lint, linter


awesome-lint


Linter for Awesome lists

Intended to make it easier to create and maintain Awesome lists.

Includes a bunch of general Markdown rules and some Awesome specific rules.

CLI

Install

Install Node.js and Git, then run:

$ npm install --global awesome-lint

Usage

Type the command awesome-lint followed by the URL of the repo you want to check:

❯ awesome-lint https://github.com/sindresorhus/awesome-something

  readme.md:1:1
  ✖    1:1  Missing Awesome badge after the main heading      awesome-badge
  ✖   12:1  Marker style should be -                          unordered-list-marker-style
  ✖  199:3  Remove trailing slash (https://sindresorhus.com)  trailing-slash

  3 errors

Special comments

You can enable, disable, and ignore rules using special comments. This is based on remark-message-control.

By default, all rules are turned on. For example, 4 errors (2 of no-dead-urls and 2 of awesome-list-item) will be generated for following code snippets.

- [foo](https://foo.com) - an invalid description.
- [foo](https://foo.com) - invalid description.
disable

The disable keyword turns off all messages of the given rule identifiers. If no identifiers are specified, all messages are turned off.

Don't leave spaces after the last rule identifier.

For example, only the 2 no-dead-urls errors are left:

<!--lint disable awesome-list-item-->
- [foo](https://foo.com) - an invalid description.
- [foo](https://foo.com) - invalid description.
enable

The enable keyword turns on all messages of the given rule identifiers. If no identifiers are specified, all messages are turned on.

For example, only the second line reports a awesome-list-item rule violation:

<!--lint disable awesome-list-item-->
- [foo](https://foo.com) - an invalid description.
<!--lint enable awesome-list-item-->
- [foo](https://foo.com) - invalid description.
ignore

The ignore keyword turns off all messages of the given rule identifiers occurring in the following node. If no identifiers are specified, all messages are turned ignored. After the end of the following node, messages are turned on again. This is the main difference with disable.

For example, to turn off certain messages for the next node:

<!--lint ignore awesome-list-item-->
- [foo](https://foo.com) - an invalid description.

List items share the same parent node. So let's create a new list.

- [foo](https://foo.com) - invalid description.

Continuous Integration

GitHub Actions

You can use GitHub Actions for free to automatically run awesome-lint against all pull requests.

Create /.github/workflows/main.yml with the following contents:

name: CI
on:
  pull_request:
    branches: [main]
jobs:
  Awesome_Lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 0
      - run: npx awesome-lint

fetch-depth: 0 is needed so that we can check the repo ago.

You may add branch protection rules to prevent merging branches not passing awesome-lint.

Travis

Add it as a test script in package.json and activate Travis CI to lint on new commits and pull requests.

Note: Travis CI only clones repositories to a maximum of 50 commits by default, which may result in a false positive of awesome/git-repo-age, and so you should set depth to false in .travis.yml if needed.

Note: Avoid rate limit problems on Travis CI by defining a GitHub personal access token in an environment variable named github_token. See defining variables in repository settings.

package.json
{
	"scripts": {
		"test": "awesome-lint"
	},
	"devDependencies": {
		"awesome-lint": "*"
	}
}
.travis.yml
language: node_js
node_js:
  - 'node'
# git:
#   depth: false

API

Install

$ npm install awesome-lint

Usage

const awesomeLint = require('awesome-lint');

awesomeLint.report();

Docs

awesomeLint()

Returns a Promise for a list of VFile objects.

awesomeLint.report()

Show the lint output. This can be custom reported by setting options.reporter=<function> and passing in options as a parameter.

Maintainers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].