Skip to content
This repository was archived by the owner on Feb 12, 2023. It is now read-only.

Commit 09fcea8

Browse files
author
Honza Bittner
committed
Add first version
1 parent 98522cc commit 09fcea8

8 files changed

+121
-2
lines changed

.gitignore

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
# Created by https://www.gitignore.io/api/dart
2+
# Edit at https://www.gitignore.io/?templates=dart
3+
4+
### Dart ###
15
# See https://www.dartlang.org/guides/libraries/private-files
26

37
# Files and directories created by pub
48
.dart_tool/
59
.packages
6-
.pub/
710
build/
811
# If you're building an application, you may want to check-in your pubspec.lock
912
pubspec.lock
1013

1114
# Directory created by dartdoc
1215
# If you don't generate documentation locally you can remove this line.
1316
doc/api/
17+
18+
# Avoid committing generated Javascript files:
19+
*.dart.js
20+
*.info.json # Produced by the --dump-info flag.
21+
*.js # When generated by dart2js. Don't specify *.js if your
22+
# project includes source files written in JavaScript.
23+
*.js_
24+
*.js.deps
25+
*.js.map
26+
27+
# End of https://www.gitignore.io/api/dart

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 1.0.0
4+
5+
- Add linst according to current state of the Effective Dart `analysis_options.yaml`.

CONTRIBUTING.md

Whitespace-only changes.

README.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
11
# effective_dart
2-
Lints from Effective Dart
2+
3+
This package provides the lints according to the [Effective Dart](https://dart.dev/guides/language/effective-dart) guide.
4+
5+
This package is inspired by the [pedantic](https://github.com/dart-lang/pedantic) package, which contains lints internally used at Google.
6+
7+
## Using the Lints
8+
9+
To use the lints add a dev dependency in your `pubspec.yaml`:
10+
11+
```yaml
12+
dev_dependencies:
13+
effective_dart: ^1.0.0
14+
```
15+
16+
Then add an include in your `analysis_options.yaml` file:
17+
18+
```yaml
19+
include: package:effective_dart/analysis_options.yaml
20+
```
21+
22+
You can always specify a specific version instead:
23+
24+
```yaml
25+
include: package:effective_dart/analysis_options.1.0.0.yaml
26+
```
27+
28+
## License
29+
30+
Licensed under the [MIT License](LICENSE).

analysis_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: lib/analysis_options.yaml

lib/analysis_options.1.0.0.yaml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
linter:
2+
rules:
3+
# STYLE
4+
- camel_case_types
5+
- library_names
6+
- file_names
7+
- library_prefixes
8+
- non_constant_identifier_names
9+
- constant_identifier_names # prefer
10+
- directives_ordering
11+
#- lines_longer_than_80_chars # avoid
12+
- curly_braces_in_flow_control_structures
13+
14+
# DOCUMENTATION
15+
- slash_for_doc_comments
16+
- package_api_docs # prefer # ?
17+
- public_member_api_docs # prefer # ?
18+
- comment_references
19+
20+
# USAGE
21+
- avoid_relative_lib_imports # prefer
22+
- prefer_adjacent_string_concatenation
23+
- prefer_interpolation_to_compose_strings # prefer
24+
- unnecessary_brace_in_string_interps # avoid
25+
- prefer_collection_literals
26+
- avoid_function_literals_in_foreach_calls # avoid
27+
- prefer_iterable_whereType
28+
- prefer_function_declarations_over_variables
29+
- unnecessary_lambdas
30+
- prefer_equal_for_default_values
31+
- avoid_init_to_null
32+
- unnecessary_getters_setters
33+
#- unnecessary_getters # prefer # Disabled pending fix: https://github.com/dart-lang/linter/issues/23
34+
#- prefer_expression_function_bodies # consider
35+
- unnecessary_this
36+
- prefer_initializing_formals
37+
- type_init_formals
38+
- empty_constructor_bodies
39+
- unnecessary_new
40+
- unnecessary_const
41+
- avoid_catches_without_on_clauses # avoid
42+
- use_rethrow_when_possible
43+
44+
# DESIGN
45+
- use_to_and_as_if_applicable # prefer
46+
- one_member_abstracts # avoid
47+
- avoid_classes_with_only_static_members # avoid
48+
- prefer_final_fields # prefer
49+
- use_setters_to_change_properties
50+
- avoid_setters_without_getters
51+
- avoid_returning_null # avoid
52+
- avoid_returning_this # avoid
53+
- type_annotate_public_apis # prefer
54+
#- prefer_typing_uninitialized_variables # consider
55+
- omit_local_variable_types # avoid
56+
- avoid_return_types_on_setters
57+
- prefer_generic_function_type_aliases
58+
- avoid_private_typedef_functions # prefer
59+
#- use_function_type_syntax_for_parameters # consider
60+
- avoid_positional_boolean_parameters # avoid
61+
- hash_and_equals
62+
- avoid_null_checks_in_equality_operators

lib/analysis_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:effective_dart/analysis_options.1.0.0.yaml

pubspec.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: effective_dart
2+
version: 1.0.0
3+
description: This package provides the lints according to the Effective Dart guide.
4+
author: Honza Bittner <git@honzabittner.cz>
5+
homepage: https://github.com/tenhobi/effective_dart
6+
7+
environment:
8+
sdk: ">=2.1.1-dev.0.0 <3.0.0"

0 commit comments

Comments
 (0)