Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deploy/effective-dart-rules/bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ Future<Null> main() async {
// Ignore the YAML front matter (can lead to false H3 elements.
lines = lines.skip(1).skipWhile((line) => line.trim() != '---').toList();
var document = new md.Document();
document.parseRefLinks(lines);

// Commented out the following line because the parseRefLinks has
// disappeared. Unfortunately, that means I had to hand-patch the TOC
// to fix the links to custom anchors. To find these, display
// localhost:4000/guides/language/effective-dart, and then search
// for "{#". Delete the excess text and fix the URL.
//document.parseRefLinks(lines);

var nodes = document.parseLines(lines);
for (md.Element element in nodes.where((node) => node is md.Element)) {
if (element.tag == "h2") {
Expand Down
8 changes: 4 additions & 4 deletions deploy/effective-dart-rules/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: effective_dart_rules
version: 0.0.1
version: 0.0.2
description: Builds a file with all the rules in the different sections of Effective Dart.
dependencies:
html_unescape: ^0.1.4
markdown: ^0.10.1
path: ^1.3.9
html_unescape: ^1.0.0
markdown: ^2.0.0
path: ^1.6.0
7 changes: 5 additions & 2 deletions src/_guides/language/effective-dart/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@ class C { ... }
[camel_case_types]: http://dart-lang.github.io/linter/lints/camel_case_types.html
[Linter rule]: /guides/language/analysis-options#the-analysis-options-file

### DO name libraries and source files using `lowercase_with_underscores`.
### DO name libraries, packages, directories, and source files using `lowercase_with_underscores`. {#do-name-libraries-and-source-files-using-lowercase_with_underscores}

{% include linter-rule.html rule1="library_names" rule2="file_names" %}
<!-- source for rules (update these if you update the guideline):
https://github.com/dart-lang/linter/blob/master/lib/src/rules/library_names.dart
https://github.com/dart-lang/linter/blob/master/lib/src/rules/file_names.dart -->

Some file systems are not case-sensitive, so many projects require filenames to
be all lowercase. Using a separating character allows names to still be readable
Expand Down Expand Up @@ -245,7 +248,7 @@ Db
{% endprettify %}


### DON’T use prefix letters
### DON’T use prefix letters.

[Hungarian notation](https://en.wikipedia.org/wiki/Hungarian_notation) and
other schemes arose in the time of BCPL, when the compiler didn't do much to
Expand Down
4 changes: 2 additions & 2 deletions src/_guides/language/effective-dart/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
**Identifiers**

* <a href='/guides/language/effective-dart/style#do-name-types-using-uppercamelcase'>DO name types using <code>UpperCamelCase</code>.</a>
* <a href='/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores'>DO name libraries and source files using <code>lowercase_with_underscores</code>.</a>
* <a href='/guides/language/effective-dart/style#do-name-libraries-and-source-files-using-lowercase_with_underscores'>DO name libraries, packages, directories, and source files using <code>lowercase_with_underscores</code>.</a>
* <a href='/guides/language/effective-dart/style#do-name-import-prefixes-using-lowercase_with_underscores'>DO name import prefixes using <code>lowercase_with_underscores</code>.</a>
* <a href='/guides/language/effective-dart/style#do-name-other-identifiers-using-lowercamelcase'>DO name other identifiers using <code>lowerCamelCase</code>.</a>
* <a href='/guides/language/effective-dart/style#prefer-using-lowercamelcase-for-constant-names'>PREFER using <code>lowerCamelCase</code> for constant names.</a>
Expand All @@ -26,7 +26,7 @@

* <a href='/guides/language/effective-dart/style#do-place-dart-imports-before-other-imports'>DO place "dart:" imports before other imports.</a>
* <a href='/guides/language/effective-dart/style#do-place-package-imports-before-relative-imports'>DO place "package:" imports before relative imports.</a>
* <a href='/guides/language/effective-dart/style#prefer-placing-third-party-package-imports-before-other-imports'>PREFER placing "third-party" "package:" imports before other imports.</a>
* <a href='/guides/language/effective-dart/style#prefer-placing-third-party-package-imports-before-other-imports'>PREFER placing external "package:" imports before other imports.</a>
* <a href='/guides/language/effective-dart/style#do-specify-exports-in-a-separate-section-after-all-imports'>DO specify exports in a separate section after all imports.</a>
* <a href='/guides/language/effective-dart/style#do-sort-sections-alphabetically'>DO sort sections alphabetically.</a>

Expand Down