Skip to content

Commit

Permalink
wrapping up
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez committed Jul 23, 2024
1 parent d61addf commit f95b094
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,13 @@ eslint_plugin_test_task:
- npm run build
- cd ../../../../its/eslint8-plugin-sonarjs
- npm run build
- npx eslint file.js || true
- npx eslint file.js || true # to check output in CI
- npx tsc --noEmit # check typings for tseslint.config.ts
- npm run test
- cd ../eslint9-plugin-sonarjs
- npm run build
- npx eslint file.js || true
- npx eslint file.js || true # to check output in CI
- npx tsc --noEmit # check typings for tseslint.config.ts
- npm run test

css_ruling_task:
Expand Down
1 change: 1 addition & 0 deletions its/eslint8-plugin-sonarjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"devDependencies": {
"cross-spawn": "7.0.3",
"eslint": "8.57.0",
"typescript": "5.5.4",
"typescript-eslint": "7.16.1"
}
}
11 changes: 10 additions & 1 deletion its/eslint9-plugin-sonarjs/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ test('should work with CommonJS config', async t => {
encoding: 'utf-8',
});
const output = result.stdout;
console.log(output);
const errorLines = output.split('\n').filter(line => line.includes('error'));
assert(errorLines.length > 4);
});
Expand All @@ -22,3 +21,13 @@ test('should work with ECMAScript modules config', async t => {
const errorLines = output.split('\n').filter(line => line.includes('error'));
assert(errorLines.length > 4);
});

test('should work with TSESLint config', async t => {
const result = spawn.sync('npx', ['eslint', '-c', 'tseslint.config.mjs', 'file.js'], {
cwd: __dirname,
encoding: 'utf-8',
});
const output = result.stdout;
const errorLines = output.split('\n').filter(line => line.includes('error'));
assert(errorLines.length > 4);
});
4 changes: 3 additions & 1 deletion its/eslint9-plugin-sonarjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
},
"devDependencies": {
"cross-spawn": "7.0.3",
"eslint": "8.57.0"
"eslint": "8.57.0",
"typescript": "5.5.4",
"typescript-eslint": "7.16.1"
}
}
9 changes: 9 additions & 0 deletions its/eslint9-plugin-sonarjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"module": "NodeNext",
"target": "es6",
"allowJs": true,
"moduleResolution": "NodeNext"
},
"files": ["tseslint.config.mjs"]
}
8 changes: 8 additions & 0 deletions its/eslint9-plugin-sonarjs/tseslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check

import plugin from 'eslint-plugin-sonarjs';
import tseslint from 'typescript-eslint';

console.log(`Loaded ${Object.keys(plugin.configs.recommended.rules).length} rules`);

export default tseslint.config(plugin.configs.recommended);

0 comments on commit f95b094

Please sign in to comment.