Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <6216144+Jaid@users.noreply.github.com>
  • Loading branch information
Jaid committed Apr 20, 2024
1 parent 9091f27 commit 7a93ed4
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 22 deletions.
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -53,7 +53,8 @@
"eslint-plugin-regexp": "^2.3.0",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-yml": "^1.13.1",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0"
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
"forward-slash-path": "^0.3.0"
},
"devDependencies": {
"@atao60/fse-cli": "^0.1.9",
Expand Down
2 changes: 1 addition & 1 deletion src/ConfigBuilder.ts
@@ -1,4 +1,4 @@
import path from 'node:path'
import * as path from 'forward-slash-path'
import {pathToFileURL} from 'node:url'

import chalk from 'chalk'
Expand Down
2 changes: 1 addition & 1 deletion src/build.ts
@@ -1,6 +1,6 @@
import type {PackageJson} from 'type-fest'

import path from 'node:path'
import * as path from 'forward-slash-path'
import {fileURLToPath, pathToFileURL} from 'node:url'

import chalk from 'chalk'
Expand Down
6 changes: 3 additions & 3 deletions src/lib/makeHtml.ts
@@ -1,13 +1,13 @@
#!/bin/env tsx
import type {Rule} from 'src/lib/listRules.ts'
import type {Rule} from 'lib/listRules.ts'

import path from 'node:path'
import * as path from 'forward-slash-path'

import fs from 'fs-extra'
import Handlebars from 'handlebars'
import * as lodash from 'lodash-es'
import showdown from 'showdown'
import getLinkToRule from 'src/lib/getLinkToRule.ts'
import getLinkToRule from 'lib/getLinkToRule.ts'

type Selector = `current` | `deprecated` | `unused`

Expand Down
2 changes: 1 addition & 1 deletion src/presets/index/index.ts
@@ -1,4 +1,4 @@
import path from 'node:path'
import * as path from 'forward-slash-path'
import {fileURLToPath} from 'node:url'

import readFileYaml from 'read-file-yaml'
Expand Down
4 changes: 2 additions & 2 deletions src/rules/perfectionist.yml
Expand Up @@ -30,15 +30,15 @@ rules:
- - parent-type # import type { Options } from '../foo.js'
- sibling-type # import type { Options } from './foo.js'
- external-type # import type { Options } from 'foo'
- - internal-type # import type { Options } from '~/lib/foo.js'
- - internal-type # import type { Options } from 'lib/foo.js'
- internalWithShortcut-type # import type { Options } from 'lib/foo.js'
- index-type # import type { Options } from './index.d.ts'
- side-effect # import 'foo'
- object # import log = console.log
- - builtin # import fs from 'fs'
- node # import fs from 'node:fs'
- external # import foo from 'foo'
- - internal # import foo from '~/lib/foo.js'
- - internal # import foo from 'lib/foo.js'
- internalWithShortcut # import foo from 'lib/foo.js'
- - parent # import { foo } from '../foo.js'
- siblings # import { foo } from './foo.js'
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/activeHtml.ts
@@ -1,9 +1,9 @@
#!/bin/env tsx
import path from 'node:path'
import * as path from 'forward-slash-path'

import fs from 'fs-extra'
import listRules from 'src/lib/listRules.js'
import makeHtml from 'src/lib/makeHtml.js'
import listRules from 'lib/listRules.js'
import makeHtml from 'lib/makeHtml.js'

const rulesFile = path.join(`dist`, `build`, `react`, `index.json`)
const groupedRules = await listRules(rulesFile, `getCurrentRules`)
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/deprecatedHtml.ts
@@ -1,9 +1,9 @@
#!/bin/env tsx
import path from 'node:path'
import * as path from 'forward-slash-path'

import fs from 'fs-extra'
import listRules from 'src/lib/listRules.js'
import makeHtml from 'src/lib/makeHtml.js'
import listRules from 'lib/listRules.js'
import makeHtml from 'lib/makeHtml.js'

const rulesFile = path.join(`dist`, `build`, `react`, `index.json`)
const groupedRules = await listRules(rulesFile, `getDeprecatedRules`)
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/unused.ts
@@ -1,7 +1,7 @@
#!/bin/env tsx
import path from 'node:path'
import * as path from 'forward-slash-path'

import listRules from 'src/lib/listRules.js'
import listRules from 'lib/listRules.js'

const rulesFile = path.join(`dist`, `build`, `react`, `index.json`)
const groupedRules = await listRules(rulesFile, `getUnusedRules`)
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/unusedHtml.ts
@@ -1,9 +1,9 @@
#!/bin/env tsx
import path from 'node:path'
import * as path from 'forward-slash-path'

import fs from 'fs-extra'
import listRules from 'src/lib/listRules.js'
import makeHtml from 'src/lib/makeHtml.js'
import listRules from 'lib/listRules.js'
import makeHtml from 'lib/makeHtml.js'

const rulesFile = path.join(`dist`, `build`, `react`, `index.json`)
const groupedRules = await listRules(rulesFile, `getUnusedRules`)
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
@@ -1,7 +1,7 @@
import type {PackageJson} from 'type-fest'

import assert from 'node:assert'
import path from 'node:path'
import * as path from 'forward-slash-path'
import test, {before} from 'node:test'
import {fileURLToPath, pathToFileURL} from 'node:url'

Expand Down

0 comments on commit 7a93ed4

Please sign in to comment.