Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
'use strict'

const globals = require('globals')
const { FlatCompat } = require('@eslint/eslintrc')
const eslintPluginEslintPlugin = require('eslint-plugin-eslint-plugin/configs/all')
const eslintPluginJsonc = require('eslint-plugin-jsonc')
const eslintPluginNodeDependencies = require('eslint-plugin-node-dependencies')
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended')
const eslintPluginUnicorn = require('eslint-plugin-unicorn')

const eslintrc = new FlatCompat({
baseDirectory: __dirname
})

module.exports = [
{
ignores: [
Expand All @@ -30,10 +27,8 @@ module.exports = [
},
eslintPluginEslintPlugin,
eslintPluginUnicorn.configs['flat/recommended'],
...eslintrc.extends(
'plugin:node-dependencies/recommended',
'plugin:jsonc/recommended-with-jsonc'
),
...eslintPluginNodeDependencies.configs['flat/recommended'],
...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
eslintPluginPrettierRecommended,
{
plugins: {
Expand Down Expand Up @@ -144,6 +139,7 @@ module.exports = [
'prefer-const': 2,

'prettier/prettier': 'error',
'eslint-plugin/require-meta-docs-recommended': 'off', // use `categories` instead
'eslint-plugin/require-meta-fixable': [
'error',
{ catchNoFixerButFixableProperty: true }
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/attribute-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
allOf: [
{ type: 'string' },
{ not: { type: 'string', pattern: ':exit$' } },
{ not: { type: 'string', pattern: '^\\s*$' } }
{ not: { type: 'string', pattern: String.raw`^\s*$` } }
]
},
uniqueItems: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/html-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = {
allOf: [
{ type: 'string' },
{ not: { type: 'string', pattern: ':exit$' } },
{ not: { type: 'string', pattern: '^\\s*$' } }
{ not: { type: 'string', pattern: String.raw`^\s*$` } }
]
},
uniqueItems: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/no-invalid-model-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/no-invalid-model-keys.html'
},
schema: [],
deprecated: true,
replacedBy: ['valid-model-definition']
replacedBy: ['valid-model-definition'],
schema: []
},
/** @param {RuleContext} context */
create(context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-restricted-custom-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module.exports = {
sourceCode.text[nameWithLoc.range[0]]
}${JSON.stringify(option.suggest)
.slice(1, -1)
.replace(/'/gu, "\\'")}${
.replace(/'/gu, String.raw`\'`)}${
sourceCode.text[nameWithLoc.range[1] - 1]
}`
)
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/no-undef-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
const options = context.options[0] || {}
const ignores = /** @type {string[]} */ (options.ignores || ['/^\\$/']).map(
toRegExp
)
const ignores = /** @type {string[]} */ (
options.ignores || [String.raw`/^\$/`]
).map(toRegExp)
const propertyReferenceExtractor = definePropertyReferenceExtractor(context)
const programNode = context.getSourceCode().ast

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/script-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
allOf: [
{ type: 'string' },
{ not: { type: 'string', pattern: ':exit$' } },
{ not: { type: 'string', pattern: '^\\s*$' } }
{ not: { type: 'string', pattern: String.raw`^\s*$` } }
]
},
uniqueItems: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/script-setup-uses-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module.exports = {
categories: undefined,
url: 'https://eslint.vuejs.org/rules/script-setup-uses-vars.html'
},
schema: [],
deprecated: true
deprecated: true,
schema: []
},
/**
* @param {RuleContext} context - The rule context.
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/v-on-event-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
allOf: [
{ type: 'string' },
{ not: { type: 'string', pattern: ':exit$' } },
{ not: { type: 'string', pattern: '^\\s*$' } }
{ not: { type: 'string', pattern: String.raw`^\s*$` } }
]
},
uniqueItems: true,
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/v-on-function-call.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module.exports = {
url: 'https://eslint.vuejs.org/rules/v-on-function-call.html'
},
fixable: 'code',
deprecated: true,
replacedBy: ['v-on-handler-style'],
schema: [
{ enum: ['always', 'never'] },
{
Expand All @@ -87,9 +89,7 @@ module.exports = {
always: "Method calls inside of 'v-on' directives must have parentheses.",
never:
"Method calls without arguments inside of 'v-on' directives must not have parentheses."
},
deprecated: true,
replacedBy: ['v-on-handler-style']
}
},
/** @param {RuleContext} context */
create(context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const RE_REGEXP_STR = /^\/(.+)\/(.*)$/u
*/
function escape(string) {
return string && RE_HAS_REGEXP_CHAR.test(string)
? string.replace(RE_REGEXP_CHAR, '\\$&')
? string.replace(RE_REGEXP_CHAR, String.raw`\$&`)
: string
}

Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"xml-name-validator": "^4.0.0"
},
"devDependencies": {
"@ota-meshi/site-kit-eslint-editor-vue": "^0.1.2",
"@stylistic/eslint-plugin": "^1.6.1",
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.0",
"@stylistic/eslint-plugin": "^2.2.2",
"@types/eslint": "^8.56.2",
"@types/eslint-visitor-keys": "^3.3.0",
"@types/natural-compare": "^1.4.3",
Expand All @@ -77,21 +77,21 @@
"@typescript-eslint/types": "^7.13.1",
"assert": "^2.1.0",
"env-cmd": "^10.1.0",
"esbuild": "^0.20.0",
"esbuild": "^0.21.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-plugin": "~5.3.0",
"eslint-plugin-eslint-plugin": "~6.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsonc": "^2.13.0",
"eslint-plugin-node-dependencies": "^0.11.2",
"eslint-plugin-node-dependencies": "^0.12.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-vue": "file:.",
"espree": "^9.6.1",
"events": "^3.3.0",
"markdownlint-cli": "^0.39.0",
"markdownlint-cli": "^0.41.0",
"mocha": "^10.3.0",
"nyc": "^15.1.0",
"nyc": "^17.0.0",
"prettier": "^3.2.5",
"typescript": "^5.3.3",
"vitepress": "^1.0.0-rc.42"
Expand Down
Loading