-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rewrite to follow other
standard
engines usage (#254)
- Loading branch information
1 parent
76a887e
commit c3de7fe
Showing
64 changed files
with
369 additions
and
3,565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": ["@commitlint/config-conventional"] } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,18 +7,15 @@ on: | |
branches: [master] | ||
|
||
jobs: | ||
build: | ||
tests: | ||
runs-on: 'ubuntu-latest' | ||
|
||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x] | ||
|
||
steps: | ||
- name: 'Checkout Project' | ||
uses: 'actions/[email protected]' | ||
with: | ||
fetch-depth: 0 | ||
- uses: 'actions/[email protected]' | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: 'actions/[email protected]' | ||
|
@@ -28,23 +25,7 @@ jobs: | |
- name: 'Install Dependencies' | ||
run: 'npm install' | ||
|
||
- name: Lint Files | ||
run: 'npm run lint' | ||
|
||
- name: 'Run Tests and Coverage' | ||
env: | ||
CI: true | ||
run: 'npm run coverage' | ||
|
||
- name: 'Coveralls Parallel' | ||
uses: 'coverallsapp/github-action@master' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel: true | ||
path-to-lcov: './coverage/lcov.info' | ||
|
||
- name: 'Coveralls Finished' | ||
uses: 'coverallsapp/github-action@master' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
- run: 'npm run lint:commit -- --to "${{ github.sha }}"' | ||
- run: 'npm run lint:standard' | ||
- run: 'npm run lint:ts-standard' | ||
- run: 'npm run test' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
package-lock = false | ||
package-lock=false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env node | ||
|
||
import { cli } from 'standard-engine' | ||
import minimist from 'minimist' | ||
|
||
import options from './options.js' | ||
import { CURRENT_WORKING_DIRECTORY } from './constants.js' | ||
import { _getTSConfigPath } from './resolve-tsconfig.js' | ||
|
||
const tsStandardCli = () => { | ||
const cliOptions = { ...options } | ||
|
||
const argv = minimist(process.argv.slice(2), { | ||
alias: { | ||
project: 'p', | ||
help: 'h' | ||
}, | ||
boolean: ['help'], | ||
string: ['project'] | ||
}) | ||
|
||
if (argv.help) { | ||
console.log( | ||
'%s - %s (%s)', | ||
cliOptions.cmd, | ||
cliOptions.tagline, | ||
cliOptions.homepage | ||
) | ||
console.log(` | ||
Usage: | ||
${cliOptions.cmd} <flags> [FILES...] | ||
If FILES is omitted, all JavaScript/TypeScript source files (*.js, *.jsx, *.mjs, *.cjs, *.ts, *.tsx) | ||
in the current working directory are checked, recursively. | ||
Certain paths (node_modules/, coverage/, vendor/, *.min.js, and | ||
files/folders that begin with '.' like .git/) are automatically ignored. | ||
Paths in a project's root .gitignore file are also automatically ignored. | ||
Flags: | ||
--fix Automatically fix problems | ||
-p, --project Specify ts-config location (default: ./tsconfig.eslint.json or ./tsconfig.json) | ||
--version Show current version | ||
-h, --help Show usage information | ||
Flags (advanced): | ||
--stdin Read file text from stdin | ||
--ext Specify JavaScript/TypeScript file extensions | ||
--global Declare global variable | ||
--plugin Use custom eslint plugin | ||
--env Use custom eslint environment | ||
--parser Use custom ts/js parser (default: @typescript-eslint/parser) | ||
`) | ||
process.exitCode = 0 | ||
return | ||
} | ||
|
||
cliOptions.eslintConfig.overrideConfig.parserOptions.project = _getTSConfigPath( | ||
CURRENT_WORKING_DIRECTORY, | ||
argv.project | ||
) | ||
|
||
cli(cliOptions) | ||
} | ||
|
||
tsStandardCli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const DEFAULT_TSCONFIG_LOCATIONS = [ | ||
'tsconfig.eslint.json', | ||
'tsconfig.json' | ||
] | ||
|
||
export const DEFAULT_EXTENSIONS = ['js', 'jsx', 'mjs', 'cjs', 'ts', 'tsx'] | ||
|
||
export const CURRENT_WORKING_DIRECTORY = process.cwd() |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.