Skip to content

Commit

Permalink
Merge pull request #28 from joaoneto/feat/import-order-eslint-rule
Browse files Browse the repository at this point in the history
feat(eslint): add import order rules
  • Loading branch information
joaoneto committed Jan 3, 2024
2 parents eb817c5 + 6b9b487 commit 973cd66
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .changeset/wise-peaches-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@guarapi/eslint-config-guarapi': patch
'@guarapi/create-guarapi-app': patch
'guarapi': patch
'basic-example': patch
---

add import order rules for eslint-config-guarapi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import pathExists from './path-exists';
import { ParsedArgsValuesObj } from '../types';
import pathExists from './path-exists';

export default async function projectDirNotExists(values: ParsedArgsValuesObj) {
const dest = path.resolve(process.cwd(), values.name);
Expand Down
13 changes: 13 additions & 0 deletions packages/eslint-config-guarapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ module.exports = {
'import/no-extraneous-dependencies': 0,
'import/prefer-default-export': 'off',
'import/extensions': ['error', 'ignorePackages', { js: 'never', ts: 'never' }],
"import/newline-after-import": ["error", { "count": 1 }],
"import/order": ["error", {
"groups": [
"external",
"builtin",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
]
}],
'prettier/prettier': ['error', { 'parser': 'typescript' }],
},
overrides: [
Expand Down
4 changes: 2 additions & 2 deletions packages/guarapi/src/guarapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { Server } from 'node:http';
import type { Http2Server } from 'node:http2';
import {
Guarapi,
GuarapiConfig,
Expand All @@ -12,6 +10,8 @@ import {
Response,
} from './types';
import { nextPipeline, createServer } from './lib';
import type { Server } from 'node:http';
import type { Http2Server } from 'node:http2';

function Guarapi(config?: GuarapiConfig): Guarapi {
let server: Server | Http2Server | null = null;
Expand Down
2 changes: 1 addition & 1 deletion packages/guarapi/src/lib/router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nextPipeline from './next-pipeline';
import { Middleware, Params, Request } from '../types';
import nextPipeline from './next-pipeline';

const BASE_URL = 'http://localhost/';

Expand Down

0 comments on commit 973cd66

Please sign in to comment.