Giter VIP home page Giter VIP logo

strict's Introduction

Strict

pub package

A heavily opinionated analysis_options for Dart & Flutter projects with strict - but justified - lint rules. Sometimes being pedantic is not enough.

Why and How

There are plenty of rules that pedantic package doesn't take full advantage of and may be useful for other projects, like teams that have fewer people, or just personal preference of being even more strict than usual with linting rules.

While this is a stricter approach, this obviously is open to any changes, suggestions and discussions - each rule deserves a why, so when the dart/linter comments are not enough or disagreed with, a more specific comment is added above each rule in lib/analysis_options.yaml.

All rules are updated on a regular basis - more specifically when a new relevant release adds and/or removes rules in the dart linter library. These updates are made and documented in lib/all_rules.yaml, just like a clone that we manually diff from the dart linter's repo.

Usage

Add this package to your dev_dependencies in your pubspec.yaml:

dev_dependencies:
  strict: ^2.1.0

and the following to your analysis_options.yaml (create one in the root of your project if you don't have it yet):

  include: package:strict/analysis_options.yaml

strict's People

Contributors

matuella avatar ggirotto avatar raphaeloliveiramoura avatar

Stargazers

 avatar Ricardo Boss avatar Priyanuj Gogoi avatar Álvaro Barros avatar Geek Fabio avatar Felipe Sales avatar Tyler Nijmeh avatar  avatar  avatar Sandro Lovnički avatar Tobias Pörtner avatar Albert Mañosa avatar Gabriel Lucena avatar Murilo Sandiego avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

strict's Issues

Ignore `one_member_abstracts` rule

At dart standards is recommended not use abstract classes with just one method, but for some cases I think is more readable and scalable use abstract classes with just one member, like this:

abstract class DeckRepository {
  Future<List<Deck>> getAllDecks();
}

https://dart-lang.github.io/linter/lints/one_member_abstracts.html

This is a point that impact the ci because we are running flutter analyse that check the style rules of project.

So we can do two things:

  1. Disable this rule at dart rules on analysis_options.yaml file like this:
include: package:strict/analysis_options.yaml

linter:
  rules:
    one_member_abstracts: false
  1. Update all places that we use abstract classes with one member like this:

image

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.