Skip to content

Commit

Permalink
Merge pull request #1427 from dtolnay/eslint
Browse files Browse the repository at this point in the history
Set up ESLint
  • Loading branch information
dtolnay authored Jan 25, 2025
2 parents 12e0f69 + e9b06f3 commit 7118ff7
Show file tree
Hide file tree
Showing 5 changed files with 1,086 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ jobs:
- name: Run clang-tidy
run: clang-tidy-18 src/cxx.cc --warnings-as-errors=*

eslint:
name: ESLint
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- run: npm install
working-directory: book
- run: npx eslint
working-directory: book

outdated:
name: Outdated
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion book/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const dirs = ['build'];
while (dirs.length) {
const dir = dirs.pop();
fs.readdirSync(dir).forEach((entry) => {
path = dir + '/' + entry;
const path = dir + '/' + entry;
const stat = fs.statSync(path);
if (stat.isDirectory()) {
dirs.push(path);
Expand Down
8 changes: 8 additions & 0 deletions book/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pluginJs from '@eslint/js';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['build/*'] },
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
pluginJs.configs.recommended,
];
Loading

0 comments on commit 7118ff7

Please sign in to comment.