All Projects → passsy → Dart Lint

passsy / Dart Lint

Licence: apache-2.0
An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Dart Lint

Ruby Saddler
Stars: ✭ 93 (-34.04%)
Mutual labels:  lint
Gocmt
Add missing comment on exported function, method, type, constant, variable in go file
Stars: ✭ 111 (-21.28%)
Mutual labels:  lint
Cohesion
A tool for measuring Python class cohesion.
Stars: ✭ 129 (-8.51%)
Mutual labels:  lint
Svlint
SystemVerilog linter
Stars: ✭ 103 (-26.95%)
Mutual labels:  lint
Zb
an opinionated repo based tool for linting, testing and building go source
Stars: ✭ 111 (-21.28%)
Mutual labels:  lint
Go Plus
An Enhanced Go Experience For The Atom Editor
Stars: ✭ 1,519 (+977.3%)
Mutual labels:  lint
Lint Diff
💅 Run eslint only in the changed parts of the code
Stars: ✭ 92 (-34.75%)
Mutual labels:  lint
Syntastic
Syntax checking hacks for vim
Stars: ✭ 11,044 (+7732.62%)
Mutual labels:  lint
Yamllint
A linter for YAML files.
Stars: ✭ 1,750 (+1141.13%)
Mutual labels:  lint
Njsscan
njsscan is a semantic aware SAST tool that can find insecure code patterns in your Node.js applications.
Stars: ✭ 128 (-9.22%)
Mutual labels:  lint
Typescript Guidelines
The TypeScript Guidebook
Stars: ✭ 104 (-26.24%)
Mutual labels:  lint
Scopelint
scopelint checks for unpinned variables in go programs
Stars: ✭ 110 (-21.99%)
Mutual labels:  lint
Editorconfig Checker
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 119 (-15.6%)
Mutual labels:  lint
Linter
Linting your CSS to limit yourself to a defined subset of values.
Stars: ✭ 100 (-29.08%)
Mutual labels:  lint
Nodejsscan
nodejsscan is a static security code scanner for Node.js applications.
Stars: ✭ 1,874 (+1229.08%)
Mutual labels:  lint
Vim Vimlint
lint for vim script
Stars: ✭ 92 (-34.75%)
Mutual labels:  lint
Config Lint
Command line tool to validate configuration files
Stars: ✭ 118 (-16.31%)
Mutual labels:  lint
Android Development Aircraft Carrier
打造安卓开发航空母舰,Android Studio 使用集锦
Stars: ✭ 138 (-2.13%)
Mutual labels:  lint
Readable Pylint Messages
List of pylint human readable message ids and dev readable codes
Stars: ✭ 134 (-4.96%)
Mutual labels:  lint
Ansible Lint Action
GitHub Action for running ansible-lint as part of your workflows! [ https://github.com/marketplace/actions/ansible-lint ]
Stars: ✭ 124 (-12.06%)
Mutual labels:  lint

Pub style: lint

Lint for Dart/Flutter

lint is a hand-picked, open-source, community-driven collection of lint rules for Dart and Flutter projects. The set of rules follows the Effective Dart: Style Guide.

This package can be used as a replacement for package:pedantic for those who prefer stricter rules.

Install

Add lint as dependency to your pubspec.yaml

dev_dependencies:
  lint: ^1.0.0

Create a analysis_options.yaml file in the root of your project and import the lint rules:

include: package:lint/analysis_options.yaml

If you're writing a package with a public API you should use the package version instead

include: package:lint/analysis_options_package.yaml

Enable/Disable rules

lint is customizable, you can add or remove rules, depending on your needs. To do so adjust your analysis_options.yaml.

include: package:lint/analysis_options.yaml

linter:
  rules:
    # ------ Disable individual rules ----- #
    #                 ---                   #
    # Turn off what you don't like.         #
    # ------------------------------------- #

    # Use parameter order as in json response
    always_put_required_named_parameters_first: false
    
    # Util classes are awesome!
    avoid_classes_with_only_static_members: false


    # ------ Enable individual rules ------ #
    #                 ---                   #
    # These rules here are good but too     #
    # opinionated to enable them by default #
    # ------------------------------------- #

    # Make constructors the first thing in every class
    sort_constructors_first: true

    # The new tabs vs. spaces. Choose wisely
    prefer_single_quotes: true
    prefer_double_quotes: true

    # Good packages document everything
    public_member_api_docs: true
    
    # Blindly follow the Flutter code style, which prefers types everywhere
    always_specify_types: true
  
    # Back to the 80s
    lines_longer_than_80_chars: true

Lint badge

You're using lint in your open-source project? Add the badge to your README.md show that you honor strict lint rules

style: lint

[![style: lint](https://img.shields.io/badge/style-lint-4BC0F5.svg)](https://pub.dev/packages/lint)

Comparison to package:pedantic

Google publicly shares their internal rules as package:pedantic in open-source. It represents what Google is enforcing internally throughout all Dart code. For a lint rule to be added to pedantic, Google has to change all code which doesn't follow the style.

This strict practice results in only 27/150+ rules to be enabled. While some are contradictory to each other and can not enabled together, a big chunk of rules isn't enabled because it requires too much work to update all of Googles existing code.

For developers outside Google, it is the norm to have separate lint rules per project. One project might enable more rules then others.

lint enables a majority of lint rules, leaving out contradictory and very opinionated rules.

License

Copyright 2019 Pascal Welsch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].