Skip to content

Commit e589e73

Browse files
authored
chore: update to eslint 9 and modern config (#700)
1 parent 8fd55ab commit e589e73

34 files changed

+533
-852
lines changed

.eslintignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 107 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,3 @@ jobs:
3333
- name: Linting
3434
if: ${{ matrix.node-version == '18' }}
3535
run: yarn lint
36-
- name: Coverage
37-
run: yarn coverage

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ dist
2929

3030
# Testing
3131
reports
32-
coverage
3332
*.lcov
3433
.nyc_output
3534

.size-limit.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ module.exports = [
3535
gzip: false,
3636
brotli: false,
3737
},
38-
];
38+
]

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
[![npm version][npm-version-src]][npm-version-href]
55
[![npm downloads][npm-downloads-src]][npm-downloads-href]
6-
[![Codecov][codecov-src]][codecov-href]
76
[![Standard JS][standard-js-src]][standard-js-href]
87

98
> [Sentry](http://sentry.io) module for [Nuxt 2](https://v2.nuxt.com/). For [Nuxt 3+](https://nuxt.com/) support see the official [`@sentry/nuxt` module](https://docs.sentry.io/platforms/javascript/guides/nuxt/).
@@ -28,7 +27,5 @@
2827
[npm-version-href]: https://npmjs.com/package/@nuxtjs/sentry
2928
[npm-downloads-src]: https://img.shields.io/npm/v/@nuxtjs/sentry/latest.svg?style=flat-square
3029
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/sentry
31-
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/sentry-module.svg?style=flat-square
32-
[codecov-href]: https://codecov.io/gh/nuxt-community/sentry-module
3330
[standard-js-src]: https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square
3431
[standard-js-href]: https://standardjs.com

docs/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ node_modules
55
.nuxt
66
.vscode
77
.DS_Store
8-
coverage
98
dist
109
sw.*
1110
.env

eslint.config.mjs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import base from 'eslint-config-rchl-base'
2+
import typescript from 'eslint-config-rchl-typescript'
3+
import vue from 'eslint-config-rchl-vue'
4+
5+
/** @type {import('eslint').Linter.Config[]} */
6+
export default [
7+
{
8+
ignores: [
9+
'**/.nuxt/',
10+
'**/dist/',
11+
'**/templates/',
12+
'node_modules/',
13+
],
14+
},
15+
...base,
16+
...typescript,
17+
...vue,
18+
{
19+
rules: {
20+
'@stylistic/indent': [
21+
'error', 2, {
22+
SwitchCase: 1,
23+
},
24+
],
25+
'@stylistic/semi': ['error', 'never'],
26+
'@stylistic/space-before-function-paren': ['error', 'always'],
27+
},
28+
},
29+
{
30+
files: ['**/*.ts', '**/*.tsx'],
31+
rules: {
32+
'@stylistic/ts/indent': [
33+
'error', 2, {
34+
SwitchCase: 1,
35+
FunctionDeclaration: { parameters: 'first' },
36+
FunctionExpression: { parameters: 'first' },
37+
CallExpression: { arguments: 'first' },
38+
},
39+
],
40+
'@stylistic/ts/member-delimiter-style': [
41+
'error', {
42+
multiline: {
43+
delimiter: 'none',
44+
},
45+
},
46+
],
47+
'@stylistic/ts/semi': ['error', 'never'],
48+
'@stylistic/ts/space-before-function-paren': ['error', 'always'],
49+
},
50+
},
51+
{
52+
files: ['**/*.vue'],
53+
rules: {
54+
'vue/html-indent': ['error', 2],
55+
'vue/script-indent': ['error', 2, { switchCase: 1 }],
56+
},
57+
},
58+
{
59+
files: ['**/.nuxt/*.js'],
60+
rules: {
61+
'@stylistic/comma-spacing': 'off',
62+
'@stylistic/key-spacing': 'off',
63+
'@stylistic/object-curly-spacing': 'off',
64+
'@stylistic/quote-props': 'off',
65+
'@stylistic/quotes': 'off',
66+
},
67+
},
68+
]

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,13 @@
3939
"dev:generate": "nuxt generate -c ./test/fixture/default/nuxt.config --force-build",
4040
"analyze": "node ./node_modules/nuxt/bin/nuxt.js build --analyze -c ./test/fixture/default/nuxt.config",
4141
"size": "yarn build && cd size-check && yarn build && cd .. && yarn size-limit",
42-
"lint": "eslint --ext .vue,.js,.ts .",
43-
"lint:fix": "eslint --ext .vue,.js,.ts . --fix",
44-
"lint:fixture": "eslint --ext .vue,.js --no-ignore 'test/fixture/*/.nuxt/sentry.*'",
42+
"lint": "eslint .",
43+
"lint:fix": "eslint . --fix",
44+
"lint:fixture": "eslint --no-ignore 'test/fixture/*/.nuxt/sentry.*'",
4545
"release": "release-it",
4646
"test": "yarn prepack && vitest run --poolOptions.threads.singleThread && yarn lint:fixture && yarn typecheck",
4747
"test:watch": "vitest",
48-
"typecheck": "yarn dev:prepare && tsc && tsc -p ./test/tsconfig.json",
49-
"coverage": "codecov"
48+
"typecheck": "yarn dev:prepare && tsc && tsc -p ./test/tsconfig.json"
5049
},
5150
"lint-staged": {
5251
"*.{js,ts,vue}": [
@@ -77,7 +76,6 @@
7776
"@nuxt/module-builder": "0.8.3",
7877
"@nuxt/types": "2.18.1",
7978
"@nuxt/typescript-build": "^3.0.2",
80-
"@nuxtjs/eslint-config-typescript": "12.1.0",
8179
"@nuxtjs/module-test-utils": "1.6.3",
8280
"@release-it/conventional-changelog": "8.0.1",
8381
"@sentry/profiling-node": "7.119.0",
@@ -87,8 +85,10 @@
8785
"@types/lodash.mergewith": "4.6.9",
8886
"@types/node": "20.16.3",
8987
"@types/request-promise-native": "1.0.21",
90-
"codecov": "3.8.3",
91-
"eslint": "8.57.0",
88+
"eslint": "^9.12.0",
89+
"eslint-config-rchl-base": "^2.0.3",
90+
"eslint-config-rchl-typescript": "^3.0.2",
91+
"eslint-config-rchl-vue": "^3.0.0",
9292
"hookable": "5.5.3",
9393
"husky": "4.3.8",
9494
"lint-staged": "15.2.10",

size-check/base/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>

size-check/lazy+tracing/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>

size-check/lazy/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>

size-check/replay/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>

size-check/tracing/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>

size-check/typescript/pages/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<h3>Client-side</h3>
66
<span id="client-side">{{ clientSentryPresent ? 'Works!' : '$sentry object is missing!' }}</span>
77
<p>
8-
<button id="crash-button" @click="crash_me()">
8+
<button id="crash-button" type="button" @click="crash_me()">
99
crash me
1010
</button>
1111
</p>
@@ -19,7 +19,6 @@ export default defineComponent({
1919
asyncData ({ $sentry, query }) {
2020
if (query.crashOnLoad) {
2121
// @ts-ignore forces a crash
22-
// eslint-disable-next-line no-undef
2322
crashOnLoad()
2423
}
2524

src/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function buildHook (nuxt: Nuxt, moduleOptions: ModuleConfiguration,
2020

2121
const templateDir = fileURLToPath(new URL('./templates', import.meta.url))
2222

23-
const pluginOptionClient = clientSentryEnabled(moduleOptions) && canInitialize(moduleOptions) ? (moduleOptions.lazy ? 'lazy' : 'client') : 'mocked'
23+
const pluginOptionClient = clientSentryEnabled(moduleOptions) && canInitialize(moduleOptions) ? moduleOptions.lazy ? 'lazy' : 'client' : 'mocked'
2424
const clientOptions: ResolvedClientOptions = defu({ config: { release } }, await resolveClientOptions(nuxt, moduleOptions, logger))
2525
addPluginTemplate({
2626
src: resolve(templateDir, `plugin.${pluginOptionClient}.js`),
@@ -65,7 +65,7 @@ export async function buildHook (nuxt: Nuxt, moduleOptions: ModuleConfiguration,
6565
export async function webpackConfigHook (nuxt: Nuxt, webpackConfigs: WebpackConfig[], options: ModuleConfiguration, logger: ConsolaInstance): Promise<void> {
6666
let WebpackPlugin: typeof import('@sentry/webpack-plugin')
6767
try {
68-
WebpackPlugin = await (import('@sentry/webpack-plugin').then(m => m.default || m))
68+
WebpackPlugin = await import('@sentry/webpack-plugin').then(m => m.default || m)
6969
} catch {
7070
throw new Error('The "@sentry/webpack-plugin" package must be installed as a dev dependency to use the "publishRelease" option.')
7171
}

0 commit comments

Comments
 (0)