diff --git a/packages/eslint-config-airbnb/README.md b/packages/eslint-config-airbnb/README.md index 4ee4925..ff2d619 100644 --- a/packages/eslint-config-airbnb/README.md +++ b/packages/eslint-config-airbnb/README.md @@ -67,3 +67,6 @@ module.exports = { ``` `createAliasSetting` accepts a map of aliases and their corresponding paths, and returns a settings object to be spread in to the `settings` field of the ESLint config. + +## IE 11 support + diff --git a/packages/eslint-config-airbnb/ie11.js b/packages/eslint-config-airbnb/ie11.js new file mode 100644 index 0000000..d0539b2 --- /dev/null +++ b/packages/eslint-config-airbnb/ie11.js @@ -0,0 +1,24 @@ +module.exports = { + parser: require.resolve('vue-eslint-parser'), + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + plugins: ['react', 'vue'], + + rules: { + // Disallow target="_blank" on links + // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md + 'react/jsx-no-target-blank': ['error', { + allowReferrer: false, + enforceDynamicLinks: 'always', + }], + + // https://eslint.vuejs.org/rules/no-template-target-blank.html + 'vue/no-template-target-blank': ['error', { + allowReferrer: false, + enforceDynamicLinks: 'always', + }], + }, +}; diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 182dbb2..872cfbe 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -5,9 +5,9 @@ "main": "index.js", "exports": { ".": "./index.js", + "./ie11": "./ie11.js", "./createAliasSetting": "./createAliasSetting.js", "./package.json": "./package.json", - "./rules/imports": "./rules/imports.js" }, "publishConfig": { @@ -47,7 +47,7 @@ "eslint-plugin-vue": "^9.2.0" }, "devDependencies": { - "eslint": "^8.2.0", - "eslint-plugin-vue": "^9.2.0" + "eslint": "^8.21.0", + "eslint-plugin-vue": "^9.3.0" } } diff --git a/packages/eslint-config-airbnb/rules/jsx.js b/packages/eslint-config-airbnb/rules/jsx.js index 009baa9..807f17b 100644 --- a/packages/eslint-config-airbnb/rules/jsx.js +++ b/packages/eslint-config-airbnb/rules/jsx.js @@ -126,9 +126,9 @@ module.exports = { // Disallow target="_blank" on links // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md 'react/jsx-no-target-blank': ['error', { - // TODO: (semver-minor) - // default to true once Vue 2 reaches EOL (so that IE support is dropped) - allowReferrer: false, + // Unllike in the `airbnb-base` ruleset, this is set to `true`, + // Because neither Vue CLI & Vite targets IE 11 by default. + allowReferrer: true, enforceDynamicLinks: 'always', }], diff --git a/packages/eslint-config-airbnb/rules/template.js b/packages/eslint-config-airbnb/rules/template.js index 0e5acb5..fa87e26 100644 --- a/packages/eslint-config-airbnb/rules/template.js +++ b/packages/eslint-config-airbnb/rules/template.js @@ -76,9 +76,9 @@ module.exports = { // https://eslint.vuejs.org/rules/no-template-target-blank.html 'vue/no-template-target-blank': ['error', { - // TODO: (semver-minor) - // default to true once Vue 2 reaches EOL (so that IE support is dropped) - allowReferrer: false, + // Unllike in the `airbnb-base` ruleset, this is set to `true`, + // Because neither Vue CLI & Vite targets IE 11 by default. + allowReferrer: true, enforceDynamicLinks: 'always', }], diff --git a/packages/eslint-config-aribnb-with-typescript/ie11.js b/packages/eslint-config-aribnb-with-typescript/ie11.js new file mode 100644 index 0000000..e6a62c8 --- /dev/null +++ b/packages/eslint-config-aribnb-with-typescript/ie11.js @@ -0,0 +1 @@ +module.exports = require('@vue/eslint-config-airbnb/ie11'); diff --git a/packages/eslint-config-aribnb-with-typescript/package.json b/packages/eslint-config-aribnb-with-typescript/package.json index 53b3a73..7f36d03 100644 --- a/packages/eslint-config-aribnb-with-typescript/package.json +++ b/packages/eslint-config-aribnb-with-typescript/package.json @@ -5,6 +5,7 @@ "main": "index.js", "exports": { ".": "./index.js", + "./ie11": "./ie11.js", "./allow-js-in-vue": "./allow-js-in-vue.js", "./allow-tsx-in-vue": "./allow-tsx-in-vue.js", "./allow-jsx-in-vue": "./allow-jsx-in-vue.js", @@ -32,13 +33,13 @@ }, "homepage": "https://github.com/vuejs/eslint-config-airbnb/blob/main/packages/eslint-config-airbnb-with-typescript#readme", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.30.7", - "@typescript-eslint/parser": "^5.30.7", + "@typescript-eslint/eslint-plugin": "^5.33.0", + "@typescript-eslint/parser": "^5.33.0", "@vue/eslint-config-airbnb": "workspace:^", "eslint-config-airbnb-typescript": "17.0.0", - "eslint-define-config": "^1.5.1", + "eslint-define-config": "^1.6.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^3.3.0", + "eslint-import-resolver-typescript": "^3.4.0", "eslint-plugin-import": "^2.26.0", "vue-eslint-parser": "^9.0.3" }, @@ -48,8 +49,8 @@ "typescript": "*" }, "devDependencies": { - "eslint": "^8.2.0", - "eslint-plugin-vue": "^9.2.0", + "eslint": "^8.21.0", + "eslint-plugin-vue": "^9.3.0", "typescript": "~4.7.4" }, "eslintConfig": {