Skip to content

Commit

Permalink
Migrate eslint to version 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Tallyb committed Sep 28, 2024
1 parent 9d1f4fc commit 6c97cdf
Show file tree
Hide file tree
Showing 17 changed files with 1,303 additions and 5,272 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

70 changes: 0 additions & 70 deletions .eslintrc.cjs

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [3.0.0](https://github.com/tallyb/cucumber7-playwright/compare/v3.0.0...v2.0.0) (2021-07-24)
Migrating to eslint 9 and typescript eslint 8.
Scripts are now compiled to esm and not to commonjs


## [1.2.0](https://github.com/tallyb/cucumber7-playwright/compare/v1.1.1...v1.2.0) (2021-07-24)


Expand Down
6 changes: 3 additions & 3 deletions cucumber.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const getWorldParams = () => {
const params = {
foo: 'bar',
foo: 'bar'
};

return params;
Expand All @@ -13,10 +13,10 @@ const config = {
'json:reports/cucumber-report.json',
'html:reports/report.html',
'summary',
'progress-bar',
'progress-bar'
],
formatOptions: { snippetInterface: 'async-await' },
worldParameters: getWorldParams(),
worldParameters: getWorldParams()
};

if (process.env.USE_ALLURE) {
Expand Down
53 changes: 53 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// @ts-check
import stylistic from '@stylistic/eslint-plugin';
import playwright from 'eslint-plugin-playwright';
import tseslint from 'typescript-eslint';

const includedFolders = ['src', 'features'];

const customizedESLint = stylistic.configs.customize({
indent: 2,
quotes: 'single',
semi: true,
jsx: true,
commaDangle: 'never',
braceStyle: '1tbs'
});

export default tseslint.config(
{
ignores: [
'**/{www,dist,build}/**/*.*',
'projects/*/!(src)/**/*.*',
`!(${includedFolders.join(',')})/**/*.*`,
'!*.{js,ts,mjs,cjs}'
]
},
{
name: 'typescript',
files: ['**/*.{ts,js,tsx,jsx,mjs,cjs,mts}'],
extends: [...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.stylisticTypeChecked],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
plugins: {
'@stylistic': stylistic
},
rules: {
...customizedESLint.rules
}
},
{
name: 'tests',
...playwright.configs['flat/recommended'],
files: ['**/*.test.{ts,js}?(x)', 'e2e/src/**/*.ts'],
rules: {
'playwright/no-wait-for-timeout': 'error',
'playwright/no-wait-for-selector': 'error'
}
}
);
Loading

0 comments on commit 6c97cdf

Please sign in to comment.