diff --git a/.eslintrc.js b/.eslintrc.js index cbd543f..3e1678a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,17 +1,26 @@ /** @type {import('eslint').Linter.Config} */ module.exports = { rules: { + '@typescript-eslint/no-unsafe-enum-comparison': 'off', + '@typescript-eslint/consistent-type-definitions': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-var-requires': 'warn', '@typescript-eslint/no-unused-vars': ['error'], '@typescript-eslint/no-floating-promises': ['error'], + '@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }], 'no-constant-binary-expression': 'error', 'array-callback-return': 'error', 'no-debugger': 'error', 'no-alert': 'error', 'no-console': ['error', { allow: ['info', 'warn', 'error', 'trace', 'time', 'timeEnd'] }], 'newline-before-return': 'error', + 'prefer-const': 'error', + 'no-else-return': 'error', + 'no-extra-semi': 'error', + curly: 'error', + eqeqeq: 'error', + 'default-case-last': 'error', 'prettier/prettier': [ 'error', { @@ -35,11 +44,13 @@ module.exports = { 'plugin:import/errors', 'plugin:import/warnings', 'plugin:import/typescript', - 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-type-checked', + 'plugin:@typescript-eslint/stylistic-type-checked', ], globals: { Atomics: 'readonly', SharedArrayBuffer: 'readonly', }, + parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'prettier'], }; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87e5572..7c0768c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - next jobs: release: diff --git a/.releaserc.json b/.releaserc.json index 82af23e..5e5e5fa 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,12 +1,16 @@ { - "branches": [ - "main" - ], - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github" - ] - } \ No newline at end of file + "branches": [ + "main", + { + "name": "next", + "prerelease": true + } + ], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github" + ] +} diff --git a/README.md b/README.md index 54f1a57..44ec663 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ Create a `.eslintrc` file in the root of your project's directory (it should liv } ``` +### NPM scripts + To use eslint add the following to your package.json: ```json @@ -40,3 +42,7 @@ To use eslint add the following to your package.json: "lint:fix": "eslint . --fix" } ``` + +### TypeScript configuration + +Since there are some rules which require type information please make sure to set up a `tsconfig.json` configuration file in the root directory of your project. If your TypeScript configuration file is placed in another location you have to configure it using `parserOptions.project` in your ESLint configuration file. For more information have a look at the [typescript-eslint documentation](https://typescript-eslint.io/packages/parser/#project).