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
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

21 changes: 20 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

name: node lint

steps:
- name: checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: setup node 22
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 22

- name: npm ci
run: npm ci

- run: npm run lint

test:
runs-on: ubuntu-latest

Expand All @@ -16,7 +35,7 @@ jobs:
matrix:
node-version: [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]

name: node v${{ matrix.node-version }} build
name: node v${{ matrix.node-version }} test

steps:
- name: checkout
Expand Down
2 changes: 1 addition & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = class extends Generator {
message: 'Your generator name',
default: makeGeneratorName(path.basename(process.cwd())),
filter: makeGeneratorName,
validate: str => {
validate(str) {
return str.length > 'generator-'.length;
}
},
Expand Down
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const { defineConfig } = require('eslint/config');
const xo = require('eslint-config-xo');
const configPrettier = require('eslint-config-prettier/flat');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const globals = require('globals');

module.exports = defineConfig([
{ ignores: ['app/templates', 'coverage', 'node_modules'] },
{ rules: xo.rules },
configPrettier,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.jest,
...globals.node
}
},
linterOptions: {
reportUnusedDisableDirectives: 'error'
},
rules: {
// Only supported in Node >=15; we still support >=10 for now
'logical-assignment-operators': 'off',

'prettier/prettier': [
'error',
{
arrowParens: 'avoid',
printWidth: 90,
singleQuote: true,
trailingComma: 'none'
}
]
}
}
]);
Loading
Loading