Skip to content

Commit 00a5159

Browse files
committed
Add eslint-plugin-simple-import-sort
...since we're touching a ton of imports anyway in this diff...
1 parent a34468c commit 00a5159

21 files changed

Lines changed: 36 additions & 6 deletions

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
project: './tsconfig.lint.json',
1717
allowAutomaticSingleRunInference: true,
1818
},
19-
plugins: ['@typescript-eslint', 'jsdoc', 'unicorn'],
19+
plugins: ['@typescript-eslint', 'jsdoc', 'unicorn', 'simple-import-sort'],
2020
root: true,
2121
reportUnusedDisableDirectives: true,
2222
rules: {
@@ -70,6 +70,8 @@ module.exports = {
7070
'jsdoc/require-param': 'off',
7171
'jsdoc/require-param-type': 'off',
7272
'jsdoc/tag-lines': 'off',
73+
'simple-import-sort/imports': 'error',
74+
'simple-import-sort/exports': 'error',
7375
'unicorn/consistent-function-scoping': [
7476
'error',
7577
{ checkArrowFunctions: false },

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
// Turn off this formatter so Prettier will be the only formatter and the user won't have to pick.
1111
"javascript.format.enable": false,
1212
"editor.codeActionsOnSave": {
13-
"source.fixAll": true,
14-
"source.organizeImports": true
13+
"source.fixAll": true
1514
}
1615
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"eslint-plugin-eslint-comments": "^3.2.0",
7373
"eslint-plugin-jsdoc": "^46.5.1",
7474
"eslint-plugin-n": "^16.0.2",
75+
"eslint-plugin-simple-import-sort": "^10.0.0",
7576
"eslint-plugin-unicorn": "^48.0.1",
7677
"eslint-plugin-vitest": "^0.3.1",
7778
"prettier-plugin-jsdoc": "^1.0.1",

pnpm-lock.yaml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Node } from '@babel/types';
22
import type { Parser, Plugin, Printer, SupportLanguage } from 'prettier';
3+
34
import { PARSER_NAME, PRINTER_NAME } from './config.js';
45
import { options } from './options.js';
56
import { parser } from './parse.js';

src/parse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getTemplateLocals } from '@glimmer/syntax';
1010
import { preprocessEmbeddedTemplates } from 'ember-template-imports/lib/preprocess-embedded-templates.js';
1111
import type { Parser } from 'prettier';
1212
import { parsers as babelParsers } from 'prettier/plugins/babel.js';
13+
1314
import {
1415
PRINTER_NAME,
1516
TEMPLATE_TAG_NAME,

src/print/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { Node } from '@babel/types';
22
import type {
33
AstPath,
4+
doc,
45
Options as PrettierOptions,
56
Printer,
6-
doc,
77
} from 'prettier';
88
import { printers as estreePrinters } from 'prettier/plugins/estree.js';
9+
910
import {
1011
TEMPLATE_TAG_CLOSE,
1112
TEMPLATE_TAG_OPEN,

src/print/template.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { TemplateLiteral } from '@babel/types';
22
import type { Options as PrettierOptions } from 'prettier';
33
import { doc } from 'prettier';
4+
45
import { TEMPLATE_TAG_CLOSE, TEMPLATE_TAG_OPEN } from '../config.js';
56
import type { Options } from '../options.js';
67
import { getTemplateSingleQuote } from '../options.js';

src/types/glimmer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@ import type {
22
ExportDefaultDeclaration,
33
ExpressionStatement,
44
Node,
5-
TSAsExpression,
65
TemplateLiteral,
6+
TSAsExpression,
77
} from '@babel/types';
88
import {
99
isArrayExpression,
1010
isClassProperty,
1111
isExportDefaultDeclaration,
1212
isExpressionStatement,
1313
isNode,
14-
isTSAsExpression,
1514
isTemplateLiteral,
15+
isTSAsExpression,
1616
} from '@babel/types';
17+
1718
import type {
1819
RawGlimmerArrayExpression,
1920
RawGlimmerClassProperty,

src/types/prettier.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { doc } from 'prettier';
2+
23
import { isRecord } from '../utils/index.js';
34

45
/** Type predicate */

0 commit comments

Comments
 (0)