8000 GitHub - jesims/jesi_dart_analysis: This package provides lint rules for Dart and Flutter which are used at JESI
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

This package provides lint rules for Dart and Flutter which are used at JESI

Notifications You must be signed in to change notification settings

jesims/jesi_dart_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JESI Dart Analysis

This package provides lint rules for Dart and Flutter which are used at JESI.

For more information on each option, see the complete list of options.

For more information about the core libraries, see the related package:

Usage

To use the linting options, add a dependencies into your pubspec.yaml:

dev_dependencies:
  lints: ^1.0.1 # Add for Dart
  # flutter_lints: ^1.0.0 # Add for Flutter
  jesi_dart_analysis:
    git:
      url: https://github.com/jesims/jesi_dart_analysis.git
      ref: #<tag, branch name, or omit to default to master>

Then, create the file analysis_options.yaml and add an include statement:

# For Dart
include: package:jesi_dart_analysis/analysis_options.yaml

# For Flutter
include: package:jesi_dart_analysis/analysis_options.flutter.yaml

This will ensure you always use the latest version of the lints.

Suppressing Lints

There may be cases where specific lint rules are undesirable. Lint rules can be suppressed at the line, file, or project level.

Line Level

To suppress a specific lint rule for a specific line of code, use an ignore comment directly above the line. Read More

// ignore: uri_does_not_exist
import '/__generated__/main.gql.dart';
import 'collection_extensions.dart';

File Level

To suppress a specific lint rule of a specific file, use an ignore_for_file comment at the top of the file. Read More

// ignore_for_file: uri_does_not_exist
import '/__generated__/main.gql.dart';
import '/__generated__/another.gql.dart';

Project Level

To suppress a specific lint rule for an entire project, modify analysis_options.yaml. Read More

include: package:jesi_dart_analysis/analysis_options.yaml
linter:
  rules:
    prefer_single_quotes: false

Maintaining

  • Follow Semantic Versioning
  • Update the CHANGELOG.md accordingly
  • When updating linter rules, ensure the rule is changed in both analysis_options.yaml and analysis_options.flutter.yaml. Unless the rule pertains exclusively to either Flutter or Dart.
  • After merging, create (and push) a new tag for the version
    1. git tag x.x.x
    2. git push -u --tags

Future Work

  • Consider CI/CD Automation
  • If package maintenance starts becoming a lot of effort maintaining two analysis files, consider creating a build script to generate, or lint, the YAML files as part of a pre-commit or pre-push hook.

About

This package provides lint rules for Dart and Flutter which are used at JESI

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  
0