Skip to content

Commit 6121ef4

Browse files
authored
Enable import sorting (#308)
1 parent 65014ac commit 6121ef4

17 files changed

+33
-30
lines changed

.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./node_modules/gts/",
3+
"rules": {
4+
"prefer-const": ["error", {"destructuring": "all"}],
5+
// It would be nice to sort import declaration order as well, but that's not
6+
// autofixable and it's not worth the effort of handling manually.
7+
"sort-imports": ["error", {"ignoreDeclarationSort": true}],
8+
}
9+
}

.eslintrc.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/src/compiler/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as p from 'path';
66
import * as supportsColor from 'supports-color';
7-
import {deprecations, getDeprecationIds, Deprecation} from '../deprecations';
7+
import {Deprecation, deprecations, getDeprecationIds} from '../deprecations';
88
import {deprotofySourceSpan} from '../deprotofy-span';
99
import {Dispatcher, DispatcherHandlers} from '../dispatcher';
1010
import {Exception} from '../exception';

lib/src/dispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {filter, map, mergeMap, takeUntil} from 'rxjs/operators';
88
import {OutboundResponse} from './messages';
99
import * as proto from './vendor/embedded_sass_pb';
1010
import {RequestTracker} from './request-tracker';
11-
import {PromiseOr, compilerError, thenOr, hostError} from './utils';
11+
import {PromiseOr, compilerError, hostError, thenOr} from './utils';
1212

1313
// A callback that accepts a response or error.
1414
type ResponseCallback = (

lib/src/importer-registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {CanonicalizeContext} from './canonicalize-context';
1111
import * as utils from './utils';
1212
import {FileImporter, Importer, Options} from './vendor/sass';
1313
import * as proto from './vendor/embedded_sass_pb';
14-
import {catchOr, thenOr, PromiseOr} from './utils';
14+
import {PromiseOr, catchOr, thenOr} from './utils';
1515

1616
const entryPointDirectoryKey = Symbol();
1717

lib/src/legacy/importer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import * as util from 'util';
99

1010
import {resolvePath} from './resolve-path';
1111
import {
12+
PromiseOr,
13+
SyncBoolean,
1214
fileUrlToPathCrossPlatform,
1315
isErrnoException,
1416
thenOr,
15-
PromiseOr,
16-
SyncBoolean,
1717
} from '../utils';
1818
import {
1919
Importer,
@@ -26,10 +26,10 @@ import {
2626
LegacySyncImporter,
2727
} from '../vendor/sass';
2828
import {
29-
pathToLegacyFileUrl,
3029
legacyFileUrlToPath,
3130
legacyImporterProtocol,
3231
legacyImporterProtocolPrefix,
32+
pathToLegacyFileUrl,
3333
} from './utils';
3434

3535
/**

lib/src/legacy/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import * as fs from 'fs';
66
import * as p from 'path';
7-
import {pathToFileURL, URL} from 'url';
7+
import {URL, pathToFileURL} from 'url';
88
import {NodePackageImporter} from '../importer-registry';
99

1010
import {Exception} from '../exception';
@@ -15,11 +15,11 @@ import {
1515
compileStringAsync,
1616
} from '../compile';
1717
import {
18+
SyncBoolean,
1819
fileUrlToPathCrossPlatform,
1920
isNullOrUndefined,
2021
pathToUrlString,
2122
withoutExtension,
22-
SyncBoolean,
2323
} from '../utils';
2424
import {
2525
CompileResult,
@@ -34,7 +34,7 @@ import {
3434
StringOptions,
3535
} from '../vendor/sass';
3636
import {wrapFunction} from './value/wrap';
37-
import {endOfLoadProtocol, LegacyImporterWrapper} from './importer';
37+
import {LegacyImporterWrapper, endOfLoadProtocol} from './importer';
3838
import {
3939
legacyImporterProtocol,
4040
pathToLegacyFileUrl,

lib/src/message-transformer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5-
import {Subject, Observable} from 'rxjs';
5+
import {Observable, Subject} from 'rxjs';
66
import * as varint from 'varint';
77

88
import {expectObservableToError} from '../../test/utils';

lib/src/packet-transformer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// MIT-style license that can be found in the LICENSE file or at
33
// https://opensource.org/licenses/MIT.
44

5-
import {Subject, Observable} from 'rxjs';
5+
import {Observable, Subject} from 'rxjs';
66

77
import {PacketTransformer} from './packet-transformer';
88

lib/src/protofier.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import {FunctionRegistry} from './function-registry';
1010
import {SassArgumentList} from './value/argument-list';
1111
import {SassColor} from './value/color';
1212
import {SassFunction} from './value/function';
13-
import {SassList, ListSeparator} from './value/list';
13+
import {ListSeparator, SassList} from './value/list';
1414
import {SassMap} from './value/map';
1515
import {SassNumber} from './value/number';
1616
import {SassString} from './value/string';
1717
import {Value} from './value';
1818
import {sassNull} from './value/null';
19-
import {sassTrue, sassFalse} from './value/boolean';
19+
import {sassFalse, sassTrue} from './value/boolean';
2020
import {
21-
CalculationValue,
22-
SassCalculation,
2321
CalculationInterpolation,
2422
CalculationOperation,
2523
CalculationOperator,
24+
CalculationValue,
25+
SassCalculation,
2626
} from './value/calculations';
2727
import {SassMixin} from './value/mixin';
2828

0 commit comments

Comments
 (0)