Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['20', '22']
node: [20, 22, 24]
name: Node ${{ matrix.node }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- run: npm ci
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,25 @@ on:
jobs:
release:
runs-on: ubuntu-latest
concurrency: "1"
concurrency:
group: release-${{ github.repository }}-${{ github.ref_name }}
cancel-in-progress: false
environment: release
permissions:
contents: write
id-token: write

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
persist-credentials: false

- name: Setup Node.js version
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm ci
Expand All @@ -37,10 +43,9 @@ jobs:
run: |
git config user.name "Uphold"
git config user.email "bot@uphold.com"
git config --global url.https://${{ secrets.RELEASE_GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Generate release
env:
NPM_TOKEN: ${{ secrets.RELEASE_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
npm run release -- --increment ${{ github.event.inputs.VERSION_BUMP }} -V
run: npm run release -- --increment "${{ github.event.inputs.VERSION_BUMP }}" -V
23 changes: 23 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
git: {
changelog: 'echo "## Changelog\\n\\n$(npx @uphold/github-changelog-generator -f unreleased | tail -n +4 -f)"',
commitMessage: 'Release ${version}',
requireBranch: 'master',
requireCommits: true,
tagName: 'v${version}'
},
github: {
release: true,
releaseName: 'v${version}'
},
hooks: {
'after:bump': `
echo "$(npx @uphold/github-changelog-generator -f v\${version})\n$(tail -n +2 CHANGELOG.md)" > CHANGELOG.md &&
git add CHANGELOG.md --all
`
},
npm: {
publish: true,
skipChecks: true
}
};
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Changelog

## [3.1.0](https://github.com/uphold/eslint-plugin-sql-template/releases/tag/3.1.0) (2025-03-20)

- Improve unsafe query detection [\#11](https://github.com/uphold/eslint-plugin-sql-template/pull/11) ([Americas](https://github.com/Americas))
- Fix `ci` README badge path [\#10](https://github.com/uphold/eslint-plugin-sql-template/pull/10) ([risantos](https://github.com/risantos))
- Upgrade to `ESLint v9` [\#9](https://github.com/uphold/eslint-plugin-sql-template/pull/9) ([risantos](https://github.com/risantos))
- Add travis build status badge [\#5](https://github.com/uphold/eslint-plugin-sql-template/pull/5) ([rplopes](https://github.com/rplopes))

## [2.0.0](https://github.com/uphold/eslint-plugin-sql-template/tree/2.0.0) (2016-10-03)
**Merged pull requests:**

- Remove lodash dependency [\#4](https://github.com/uphold/eslint-plugin-sql-template/pull/4) ([kurayama](https://github.com/kurayama))
- Use mocha --recursive flag [\#3](https://github.com/uphold/eslint-plugin-sql-template/pull/3) ([kurayama](https://github.com/kurayama))
- Update README [\#2](https://github.com/uphold/eslint-plugin-sql-template/pull/2) ([kurayama](https://github.com/kurayama))
- Create project with `no-unsafe-query` rule [\#1](https://github.com/uphold/eslint-plugin-sql-template/pull/1) ([rplopes](https://github.com/rplopes))

22 changes: 10 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
* Module dependencies.
*/

const { defineConfig } = require('eslint/config');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const globals = require('globals');
const js = require('@eslint/js');
const eslintPluginSqlTemplate = require('.');

/**
* Export `eslint-config`.
* Export ESLint config.
*/

module.exports = [
module.exports = defineConfig([
js.configs.recommended,
eslintPluginPrettierRecommended,
{
languageOptions: {
sourceType: 'commonjs'
},
plugins: {
'sql-template': eslintPluginSqlTemplate
},
name: 'eslint-plugin-sql-template/config',
rules: {
'prettier/prettier': [
'error',
Expand All @@ -29,12 +32,7 @@ module.exports = [
}
],
'sql-template/no-unsafe-query': 'error'
},
languageOptions: {
globals: {
...globals.mocha,
...globals.node
}
}
}
];
},
eslintPluginPrettierRecommended
]);
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
'use strict';

const { name, version } = require('./package.json');

/**
* Export rules.
* @type {import('eslint').ESLint.Plugin}
*/

module.exports = {
meta: {},
configs: {},
meta: {
name,
version,
namespace: 'sql-template'
},
rules: {
'no-unsafe-query': require('./rules/no-unsafe-query')
},
processors: {}
}
};
Loading
Loading