Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated lints, enable/fix all dartfmt --fix lints #240

Merged
merged 1 commit into from
Mar 25, 2019
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
4 changes: 3 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ linter:
- overridden_fields
- package_api_docs
- prefer_final_fields
- prefer_generic_function_type_aliases
- prefer_is_not_empty
#- prefer_single_quotes
- slash_for_doc_comments
- super_goes_last
- test_types_in_equals
- throw_in_finally
- type_init_formals
- unnecessary_brace_in_string_interps
- unnecessary_const
- unnecessary_new
- unrelated_type_equality_checks
- valid_regexps
6 changes: 3 additions & 3 deletions benchmark/benchmark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main(List<String> args) {
// Run the benchmark several times. This ensures the VM is warmed up and lets
// us see how much variance there is.
for (var i = 0; i <= numTrials; i++) {
var start = new DateTime.now();
var start = DateTime.now();

// For a single benchmark, convert the source multiple times.
var result;
Expand All @@ -29,7 +29,7 @@ void main(List<String> args) {
}

var elapsed =
new DateTime.now().difference(start).inMilliseconds / runsPerTrial;
DateTime.now().difference(start).inMilliseconds / runsPerTrial;

// Keep track of the best run so far.
if (elapsed >= best) continue;
Expand All @@ -53,7 +53,7 @@ void main(List<String> args) {

String loadFile(String name) {
var path = p.join(p.dirname(p.fromUri(Platform.script)), name);
return new File(path).readAsStringSync();
return File(path).readAsStringSync();
}

void printResult(String label, double time) {
Expand Down
6 changes: 3 additions & 3 deletions bin/markdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final extensionSets = <String, ExtensionSet>{
};

Future main(List<String> args) async {
var parser = new ArgParser()
var parser = ArgParser()
..addFlag('help', negatable: false, help: 'Print help text and exit')
..addFlag('version', negatable: false, help: 'Print version and exit')
..addOption('extension-set',
Expand Down Expand Up @@ -47,13 +47,13 @@ Future main(List<String> args) async {

if (results.rest.length == 1) {
// Read argument as a file path.
var input = new File(results.rest.first).readAsStringSync();
var input = File(results.rest.first).readAsStringSync();
print(markdownToHtml(input, extensionSet: extensionSet));
return;
}

// Read from stdin.
var buffer = new StringBuffer();
var buffer = StringBuffer();
String line;
while ((line = stdin.readLineSync()) != null) {
buffer.writeln(line);
Expand Down
8 changes: 4 additions & 4 deletions example/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ final markdownInput = querySelector('#markdown') as TextAreaElement;
final htmlDiv = querySelector('#html') as DivElement;
final versionSpan = querySelector('.version') as SpanElement;

final nullSanitizer = new NullTreeSanitizer();
const typing = const Duration(milliseconds: 150);
final nullSanitizer = NullTreeSanitizer();
const typing = Duration(milliseconds: 150);
final introText = r'''Markdown is the **best**!
* It has lists.
Expand Down Expand Up @@ -89,10 +89,10 @@ void _typeItOut(String msg, int pos) {
markdownInput.focus();
_renderMarkdown();
pos++;
timer = new Timer(typing, addCharacter);
timer = Timer(typing, addCharacter);
}

timer = new Timer(typing, addCharacter);
timer = Timer(typing, addCharacter);
}

void _switchFlavor(Event e) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

typedef Node Resolver(String name, [String title]);
typedef Resolver = Node Function(String name, [String title]);

/// Base class for any AST item.
///
Expand Down Expand Up @@ -35,7 +35,7 @@ class Element implements Node {

/// Instantiates a [tag] Element with a single Text child.
Element.text(this.tag, String text)
: children = [new Text(text)],
: children = [Text(text)],
attributes = {};

/// Whether this element is self-closing.
Expand Down
Loading