Skip to content

Commit

Permalink
Github workflows update
Browse files Browse the repository at this point in the history
  • Loading branch information
burtek committed May 16, 2023
1 parent db8ac2a commit f280da1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Check PR'

on:
pull_request

jobs:
check-pr:
name: 'Check PR'
runs-on: ubuntu-latest

steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v3'
- name: 'Setup node'
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: 'Install dependencies'
run: yarn
# - name: 'Test configs'
# run: yarn test
- name: 'Lint configs'
run: yarn lint
6 changes: 4 additions & 2 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ jobs:
run: yarn
# - name: 'Test configs'
# run: yarn test
- name: 'Lint configs'
run: yarn lint
- name: 'Publish package'
run: "yarn publish --tag ${{ (contains(github.ref_name, '-alpha') && 'alpha') || (contains(github.ref_name, '-beta') && 'beta') || 'latest' }} --access public"
run: "yarn publish --tag ${{ ((contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta')) && 'next') || 'latest' }} --access public"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# @dtrw/eslint-config

![npm version](https://badge.fury.io/js/@dtrw%2Feslint-config.svg)
![npm version](https://img.shields.io/npm/v/@dtrw/eslint-config/latest)
![npm next version](https://img.shields.io/npm/v/@dtrw/eslint-config/next)
![NPM License](https://img.shields.io/npm/l/@dtrw/eslint-config)
![Release](https://img.shields.io/github/actions/workflow/status/burtek/eslint-config/make-release.yml?label=publish%20release)


This is repository with my `eslint` configs for multiple purposes that are used (or will be used) in my other projects.

Expand Down
10 changes: 8 additions & 2 deletions configs/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import jsonParser from 'jsonc-eslint-parser';
/** @typedef {Partial<import('eslint-define-config/src/rules/jsonc/index.js').JsoncRules>} JsoncRules */
/** @typedef {Partial<import('eslint-define-config/src/rules/eslint/index.js').EslintRules>} EslintRules */

const wellKnownJsonc = [
'**/tsconfig.json',
'**/jsconfig.json',
'.vscode/**/*.json'
];

/**
* @param {Object} [config]
* @param {Partial<Record<'json' | 'jsonc' | 'json5', string[]>>} [config.additionalFiles]
Expand All @@ -25,14 +31,14 @@ export function prepareConfig({
},
{
files: ['**/*.json', ...additionalFilesJson],
ignores: ['**/tsconfig.json', '**/jsconfig.json', '.vscode/**/*.json'],
ignores: [...wellKnownJsonc],
rules: {
.../** @type {JsoncRules} */(jsonc.configs['recommended-with-json'].rules),
'jsonc/indent': ['error', 2]
}
},
{
files: ['**/*.jsonc', '**/tsconfig.json', '**/jsconfig.json', '.vscode/**/*.json', ...additionalFilesJsonc],
files: ['**/*.jsonc', ...wellKnownJsonc, ...additionalFilesJsonc],
rules: {
.../** @type {JsoncRules} */(jsonc.configs['recommended-with-jsonc'].rules),
'jsonc/indent': ['error', 2]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"private": false,
"scripts": {
"lint": "eslint configs/**/*.js rules/**/*.js",
"test": "node tests/run-tests.js",
"preversion-temp-disabled": "yarn test",
"push": "git push --follow-tags",
Expand Down

0 comments on commit f280da1

Please sign in to comment.