Skip to content

Commit 4a7f6a6

Browse files
authored
chore: organize imports in playwright-core (#34680)
1 parent 4bc8cf0 commit 4a7f6a6

File tree

226 files changed

+1699
-1115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+1699
-1115
lines changed

eslint.config.mjs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import notice from 'eslint-plugin-notice';
2020
import path from 'path';
2121
import { fileURLToPath } from 'url';
2222
import stylistic from '@stylistic/eslint-plugin';
23+
import importRules from 'eslint-plugin-import';
2324

2425
const __filename = fileURLToPath(import.meta.url);
2526
const __dirname = path.dirname(__filename);
@@ -28,6 +29,7 @@ const plugins = {
2829
'@stylistic': stylistic,
2930
'@typescript-eslint': typescriptEslint,
3031
notice,
32+
import: importRules,
3133
};
3234

3335
const ignores = [
@@ -57,7 +59,7 @@ const ignores = [
5759

5860
export const baseRules = {
5961
'@typescript-eslint/no-unused-vars': [2, { args: 'none', caughtErrors: 'none' }],
60-
'@typescript-eslint/consistent-type-imports': [2, { disallowTypeAnnotations: false }],
62+
6163
/**
6264
* Enforced rules
6365
*/
@@ -184,6 +186,19 @@ const noRestrictedGlobalsRules = {
184186
],
185187
};
186188

189+
const importOrderRules = {
190+
'import/order': [2, {
191+
'alphabetize': {
192+
'order': 'asc',
193+
'caseInsensitive': false
194+
},
195+
'named': true,
196+
'groups': ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index', 'type'],
197+
'newlines-between': 'always',
198+
}],
199+
'import/consistent-type-specifier-style': [2, 'prefer-top-level']
200+
};
201+
187202
const languageOptions = {
188203
parser: tsParser,
189204
ecmaVersion: 9,
@@ -217,6 +232,11 @@ export default [{
217232
'message': 'Please use gracefullyProcessExitDoNotHang function to exit the process.',
218233
}],
219234
}
235+
}, {
236+
files: ['packages/playwright-core/**/*.ts'],
237+
rules: {
238+
...importOrderRules
239+
},
220240
}, {
221241
files: ['packages/playwright/**/*.ts'],
222242
rules: {

package-lock.json

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

0 commit comments

Comments
 (0)