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

Enable import sorting #308

Merged
merged 1 commit into from
Jul 24, 2024
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: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./node_modules/gts/",
"rules": {
"prefer-const": ["error", {"destructuring": "all"}],
// It would be nice to sort import declaration order as well, but that's not
// autofixable and it's not worth the effort of handling manually.
"sort-imports": ["error", {"ignoreDeclarationSort": true}],
}
}
6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion lib/src/compiler/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import * as p from 'path';
import * as supportsColor from 'supports-color';
import {deprecations, getDeprecationIds, Deprecation} from '../deprecations';
import {Deprecation, deprecations, getDeprecationIds} from '../deprecations';
import {deprotofySourceSpan} from '../deprotofy-span';
import {Dispatcher, DispatcherHandlers} from '../dispatcher';
import {Exception} from '../exception';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {filter, map, mergeMap, takeUntil} from 'rxjs/operators';
import {OutboundResponse} from './messages';
import * as proto from './vendor/embedded_sass_pb';
import {RequestTracker} from './request-tracker';
import {PromiseOr, compilerError, thenOr, hostError} from './utils';
import {PromiseOr, compilerError, hostError, thenOr} from './utils';

// A callback that accepts a response or error.
type ResponseCallback = (
Expand Down
2 changes: 1 addition & 1 deletion lib/src/importer-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {CanonicalizeContext} from './canonicalize-context';
import * as utils from './utils';
import {FileImporter, Importer, Options} from './vendor/sass';
import * as proto from './vendor/embedded_sass_pb';
import {catchOr, thenOr, PromiseOr} from './utils';
import {PromiseOr, catchOr, thenOr} from './utils';

const entryPointDirectoryKey = Symbol();

Expand Down
6 changes: 3 additions & 3 deletions lib/src/legacy/importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import * as util from 'util';

import {resolvePath} from './resolve-path';
import {
PromiseOr,
SyncBoolean,
fileUrlToPathCrossPlatform,
isErrnoException,
thenOr,
PromiseOr,
SyncBoolean,
} from '../utils';
import {
Importer,
Expand All @@ -26,10 +26,10 @@ import {
LegacySyncImporter,
} from '../vendor/sass';
import {
pathToLegacyFileUrl,
legacyFileUrlToPath,
legacyImporterProtocol,
legacyImporterProtocolPrefix,
pathToLegacyFileUrl,
} from './utils';

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/src/legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import * as fs from 'fs';
import * as p from 'path';
import {pathToFileURL, URL} from 'url';
import {URL, pathToFileURL} from 'url';
import {NodePackageImporter} from '../importer-registry';

import {Exception} from '../exception';
Expand All @@ -15,11 +15,11 @@ import {
compileStringAsync,
} from '../compile';
import {
SyncBoolean,
fileUrlToPathCrossPlatform,
isNullOrUndefined,
pathToUrlString,
withoutExtension,
SyncBoolean,
} from '../utils';
import {
CompileResult,
Expand All @@ -34,7 +34,7 @@ import {
StringOptions,
} from '../vendor/sass';
import {wrapFunction} from './value/wrap';
import {endOfLoadProtocol, LegacyImporterWrapper} from './importer';
import {LegacyImporterWrapper, endOfLoadProtocol} from './importer';
import {
legacyImporterProtocol,
pathToLegacyFileUrl,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/message-transformer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {Subject, Observable} from 'rxjs';
import {Observable, Subject} from 'rxjs';
import * as varint from 'varint';

import {expectObservableToError} from '../../test/utils';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/packet-transformer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {Subject, Observable} from 'rxjs';
import {Observable, Subject} from 'rxjs';

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

Expand Down
8 changes: 4 additions & 4 deletions lib/src/protofier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import {FunctionRegistry} from './function-registry';
import {SassArgumentList} from './value/argument-list';
import {SassColor} from './value/color';
import {SassFunction} from './value/function';
import {SassList, ListSeparator} from './value/list';
import {ListSeparator, SassList} from './value/list';
import {SassMap} from './value/map';
import {SassNumber} from './value/number';
import {SassString} from './value/string';
import {Value} from './value';
import {sassNull} from './value/null';
import {sassTrue, sassFalse} from './value/boolean';
import {sassFalse, sassTrue} from './value/boolean';
import {
CalculationValue,
SassCalculation,
CalculationInterpolation,
CalculationOperation,
CalculationOperator,
CalculationValue,
SassCalculation,
} from './value/calculations';
import {SassMixin} from './value/mixin';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/sync-process/sync-message-port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import {strict as assert} from 'assert';
import {EventEmitter} from 'events';
import {
receiveMessageOnPort,
MessageChannel,
MessagePort,
TransferListItem,
receiveMessageOnPort,
} from 'worker_threads';

// TODO(nex3): Make this its own package.
Expand Down
6 changes: 3 additions & 3 deletions lib/src/sync-process/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// https://opensource.org/licenses/MIT.

import {
parentPort,
workerData,
MessagePort,
TransferListItem,
parentPort,
workerData,
} from 'worker_threads';
import {spawn, SpawnOptionsWithoutStdio} from 'child_process';
import {SpawnOptionsWithoutStdio, spawn} from 'child_process';
import {strict as assert} from 'assert';

import {SyncMessagePort} from './sync-message-port';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/argument-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {isOrderedMap, List, OrderedMap} from 'immutable';
import {List, OrderedMap, isOrderedMap} from 'immutable';

import {ListSeparator, SassList} from './list';
import {Value} from './index';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/calculations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {hash, List, ValueObject} from 'immutable';
import {List, ValueObject, hash} from 'immutable';

import {Value} from './index';
import {SassNumber} from './number';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {hash, isList, List} from 'immutable';
import {List, hash, isList} from 'immutable';

import {Value} from './index';
import {SassMap} from './map';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/value/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {hash, List} from 'immutable';
import {List, hash} from 'immutable';

import {asImmutableList, valueError} from '../utils';
import {Value} from './index';
Expand Down
2 changes: 1 addition & 1 deletion tool/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import {promises as fs, existsSync, lstatSync} from 'fs';
import {existsSync, promises as fs, lstatSync} from 'fs';
import * as p from 'path';
import * as shell from 'shelljs';

Expand Down
Loading