diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..010f2a5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# https://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{cjs,js,json,jsonld,mjs,yaml,yml}] +indent_style = space +indent_size = 2 diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 92ee1d0..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - es6: true - }, - extends: [ - 'plugin:eslint-plugin/recommended', - './index.js' - ] -}; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yaml similarity index 73% rename from .github/workflows/main.yml rename to .github/workflows/main.yaml index 17cea9c..f31cd26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -name: Lint CI +name: Main CI on: [push] @@ -8,11 +8,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [14.x] + node-version: [24.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/CHANGELOG.md b/CHANGELOG.md index 06249e0..1c8f5b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # eslint-config-digitalbazaar ChangeLog +### 6.0.0 - 2025-08-xx + +### Changed +- **BREAKING**: Update to `eslint@9`. + - Please see the migration notes below. + - Comments and suggestions welcome for how best to adapt to the rules that + were changed, added, or removed between v8 and v9. + - The way configuration is done change significantly. Suggestions welcome on + how best to adapt to the new style. +- **BREAKING**: Set `ecmaVersion` to `latest`. Override in project config if a + specific version limitation is required. +- **BREAKING**: Change `'@stylistic/comma-dangle'` to `'never'` from + `'only-multiline'`. Changed to enforce a more uniform style. Override locally + if it causes issues. +- **BREAKING**: Rename `vue` config to `vue2`. Various projects have been using + `vue` when they should be using `vue3`. This will make usage more explicit. + +### Migration +- ESLint v9 is a major breaking change and will require manual updates. +- ESLint has a migration guide: + - https://eslint.org/docs/latest/use/configure/migration-guide +- A few major notes: + - The configuration file changes from multiple `.eslintrc.cjs` or similar to + a single top level `eslint.config.js`. + - Invocation is now `eslint` without options. + - Style rules were deprecated and moved to the stylistic project. + - The Digital Bazaar rules are mostly the same as before with updates to + `@stylistic/RULENAME` as needed. + - Note the common `max-len` is now `@stylistic/max-len`. + - Unused rules are now flagged which should help with migration to new rules, + or elimination of unused rules. + - Quasar has not yet updated support for v9. Until that is updated, stay with + v8, or update to v9 and drop Quasar linting and only use Vue linting. +- Major types of rules are grouped together. +- The groups can be composed together as needed. +- There are opinionated configs that compose a number of rules and apply to + many common Digital Bazaar repositories. +- See the [README](./README.md) for notes and usage examples. + ### 5.2.0 - 2024-05-02 ### Changed diff --git a/README.md b/README.md index 3547325..5fbf390 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,9 @@ There are 6 rule sets: 2. `eslint-config-digitalbazaar/import`: Rules for es6 imports in the browser and node. 3. `eslint-config-digitalbazaar/jsdoc`: Rules for JSDoc for both node and the browser. 4. `eslint-config-digitalbazaar/module`: Rules for modules for both node and the browser. -5. `eslint-config-digitalbazaar/vue`: Rules for Vue 2 projects and browser only. +5. `eslint-config-digitalbazaar/vue2`: Rules for Vue 2 projects and browser only. 6. `eslint-config-digitalbazaar/vue3`: Rules for Vue 3 projects and browser only. - ## Installation If you do not have eslint installed: @@ -25,7 +24,7 @@ npx eslint --init ``` or rename a template from the templates dir ``` -cp node_modules/eslint-config-digitalbazaar/templates/node.js ./.eslintrc.cjs +cp node_modules/eslint-config-digitalbazaar/templates/node.js ./eslint.config.js ``` ## Usage @@ -33,9 +32,9 @@ cp node_modules/eslint-config-digitalbazaar/templates/node.js ./.eslintrc.cjs All rules can be accessed via the shorthand `digitalbazaar` or using the full module name `eslint-config-digitalbazaar`. -Eslint's documentation on [shareable configs](https://eslint.org/docs/developer-guide/shareable-configs) can be found here. +ESLint's documentation on [shareable configs](https://eslint.org/docs/developer-guide/shareable-configs) can be found here. -Example .eslintrc.cjs root setup: +Example `eslint.config.js` root setup: ```js module.exports = { root: true, @@ -52,7 +51,7 @@ To use the import rules you need to install [`eslint-plugin-import`](https://git npm i -D eslint-plugin-import ``` -Example .eslintrc.cjs import setup: +Example `eslint.config.js` import setup: ```js module.exports = { extends: ['digitalbazaar/import'] @@ -66,7 +65,7 @@ To use the JSDoc rules you will need to install [`eslint-plugin-jsdoc`](https:// npm i -D eslint-plugin-jsdoc ``` -Example .eslintrc.cjs JSDoc setup: +Example `eslint.config.js` JSDoc setup: ```js module.exports = { // only the JSDoc rules and any rules in parent dirs @@ -81,7 +80,7 @@ To use ES module code rather than CommonJS, you will need to install [`eslint-pl npm i -D eslint-plugin-unicorn ``` -Example .eslintrc.cjs ESM setup: +Example `eslint.config.js` ESM setup: ```js module.exports = { // only the module rules and any rules in parent dirs @@ -96,11 +95,11 @@ To use the Vue 2 rules you will need to install [`eslint-plugin-vue`](https://es npm i -D eslint-plugin-vue ``` -Example .eslintrc.cjs Vue setup: +Example `eslint.config.js` Vue setup: ```js module.exports = { // only the vue rules and any rules in parent dirs - extends: ['digitalbazaar/vue'] + extends: ['digitalbazaar/vue2'] } ``` @@ -114,7 +113,7 @@ To use the Vue 3 rules you will need to install [`eslint-plugin-vue`](https://es npm i -D eslint-plugin-vue ``` -Example .eslintrc.cjs Vue setup: +Example `eslint.config.js` Vue setup: ```js module.exports = { // only the vue3 rules and any rules in parent dirs diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..a2379c1 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,19 @@ +import digitalbazaar from './index.js'; +import digitalbazaarImport from './import.js'; +import globals from 'globals'; + +export default [ + ...digitalbazaar, + { + files: ['**/*.js'], + languageOptions: { + globals: { + ...globals.node + } + } + }, + { + ...digitalbazaarImport, + files: ['test/import/*.js'] + } +]; diff --git a/import.js b/import.js index 787cf80..456968e 100644 --- a/import.js +++ b/import.js @@ -1,35 +1,37 @@ -module.exports = { - env: { - es2020: true - }, - parserOptions: { - sourceType: 'module' - }, - plugins: [ - // https://github.com/import-js/eslint-plugin-import - 'import' - ], - rules: { - // Verifies that all named imports are part of the set of named - // exports in the imported module. - 'import/named': 'error', - // If a default import is requested, this rule will report if - // there is no default export in the imported module. - 'import/default': 'error', - // throws if a namespace like `import * as all` is used and - // `all.foo` is not exported - 'import/namespace': 'error', - // throws if a module imports itself - 'import/no-self-import': 'error', - // Reports funny business with exports, like repeated exports - // of names or defaults. - 'import/export': 'error', - // warns if an imported member if marked @deprecated - 'import/no-deprecated': 'error', - // warns if a dep is not in the package.json - 'import/no-extraneous-dependencies': 'error', - // disallows exporting members with let & var - // throw if you import something more than once in a file/module - 'import/no-duplicates': 'error' +import eslintPluginImport from 'eslint-plugin-import'; + +export default [ + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + plugins: { + // https://github.com/import-js/eslint-plugin-import + import: eslintPluginImport + }, + rules: { + // Verifies that all named imports are part of the set of named + // exports in the imported module. + 'import/named': 'error', + // If a default import is requested, this rule will report if + // there is no default export in the imported module. + 'import/default': 'error', + // throws if a namespace like `import * as all` is used and + // `all.foo` is not exported + 'import/namespace': 'error', + // throws if a module imports itself + 'import/no-self-import': 'error', + // Reports funny business with exports, like repeated exports + // of names or defaults. + 'import/export': 'error', + // warns if an imported member if marked @deprecated + 'import/no-deprecated': 'error', + // warns if a dep is not in the package.json + 'import/no-extraneous-dependencies': 'error', + // disallows exporting members with let & var + // throw if you import something more than once in a file/module + 'import/no-duplicates': 'error' + } } -}; +]; diff --git a/index.js b/index.js index d05909a..75b6f85 100644 --- a/index.js +++ b/index.js @@ -1,80 +1,94 @@ -module.exports = { - env: { - es2022: true +import js from '@eslint/js'; +import stylistic from '@stylistic/eslint-plugin'; + +export default [ + js.configs.recommended, + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + rules: { + curly: 'error', + 'dot-notation': 'error', + 'no-empty-pattern': ['error', {allowObjectPatternsAsParameters: true}], + 'no-spaced-func': 'error', + 'no-use-before-define': ['error', {functions: false, classes: true}], + 'no-var': 'error', + 'object-shorthand': ['error', 'properties'], + 'one-var': ['error', 'never'], + 'prefer-const': 'error', + 'sort-imports': ['error', { + allowSeparatedGroups: true, + ignoreCase: true, + memberSyntaxSortOrder: ['all', 'multiple', 'single', 'none'] + }], + yoda: 'error', + // deprecated in v8.46.0 + 'no-return-await': 'error' + } }, - parserOptions: { - sourceType: 'module' - }, - rules: { - 'arrow-parens': ['error', 'as-needed'], - 'arrow-spacing': 'error', - 'block-spacing': ['error', 'never'], - 'brace-style': ['error', '1tbs'], - 'comma-dangle': ['error', 'only-multiline'], - 'comma-spacing': 'error', - curly: 'error', - 'dot-notation': 'error', - 'eol-last': 'error', - 'key-spacing': ['error', {beforeColon: false, afterColon: true}], - 'keyword-spacing': ['error', {overrides: { - catch: {after: false}, - for: {after: false}, - if: {after: false}, - switch: {after: false}, - while: {after: false} - }}], - indent: ['error', 2, { - SwitchCase: 1, - FunctionExpression: { - parameters: 1 - }, - CallExpression: {arguments: 1} - }], - 'linebreak-style': ['error', 'unix'], - 'max-len': ['error', { - code: 80, - ignorePattern: '\\* SPDX-License-Identifier: ', - ignoreUrls: true - }], - 'no-cond-assign': 'error', - 'no-const-assign': 'error', - 'no-dupe-keys': 'error', - 'no-extra-semi': 'error', - 'no-irregular-whitespace': 'error', - 'no-loss-of-precision': 'error', - 'no-mixed-spaces-and-tabs': 'error', - 'no-multi-spaces': 'error', - 'no-multiple-empty-lines': ['error', {max: 1}], - 'no-return-await': 'error', - 'no-spaced-func': 'error', - 'no-trailing-spaces': 'error', - 'no-undef': 'error', - 'no-unused-vars': 'error', - 'no-use-before-define': ['error', {functions: false, classes: true}], - 'no-var': 'error', - 'object-curly-spacing': 'error', - 'object-shorthand': ['error', 'properties'], - 'one-var': ['error', 'never'], - 'operator-linebreak': ['error', 'after'], - 'prefer-const': 'error', - quotes: ['error', 'single', {allowTemplateLiterals: true}], - 'quote-props': ['error', 'as-needed'], - semi: ['error', 'always'], - 'semi-spacing': 'error', - 'sort-imports': ['error', { - allowSeparatedGroups: true, - ignoreCase: true, - memberSyntaxSortOrder: ['all', 'multiple', 'single', 'none'] - }], - 'space-before-blocks': 'error', - 'space-before-function-paren': ['error', { - anonymous: 'never', - named: 'never', - asyncArrow: 'always' - }], - 'space-infix-ops': 'error', - 'space-in-parens': ['error', 'never'], - 'valid-typeof': 'error', - yoda: 'error' + { + // stylistic rules + // https://eslint.style/rules + plugins: { + '@stylistic': stylistic + }, + rules: { + '@stylistic/arrow-parens': ['error', 'as-needed'], + '@stylistic/arrow-spacing': 'error', + '@stylistic/block-spacing': ['error', 'never'], + '@stylistic/brace-style': ['error', '1tbs'], + '@stylistic/comma-dangle': ['error', 'never'], + '@stylistic/comma-spacing': 'error', + '@stylistic/eol-last': 'error', + '@stylistic/key-spacing': ['error', { + beforeColon: false, + afterColon: true + }], + '@stylistic/keyword-spacing': ['error', {overrides: { + catch: {after: false}, + for: {after: false}, + if: {after: false}, + switch: {after: false}, + while: {after: false} + }}], + '@stylistic/indent': ['error', 2, { + SwitchCase: 1, + FunctionExpression: { + parameters: 1 + }, + CallExpression: {arguments: 1} + }], + '@stylistic/linebreak-style': ['error', 'unix'], + '@stylistic/max-len': ['error', { + code: 80, + ignorePattern: '\\* SPDX-License-Identifier: ', + ignoreUrls: true + //ignoreRegExpLiterals: true + }], + '@stylistic/no-extra-semi': 'error', + '@stylistic/no-mixed-spaces-and-tabs': 'error', + '@stylistic/no-multi-spaces': 'error', + '@stylistic/no-multiple-empty-lines': ['error', {max: 1}], + '@stylistic/no-trailing-spaces': 'error', + '@stylistic/object-curly-spacing': 'error', + '@stylistic/operator-linebreak': ['error', 'after'], + '@stylistic/quotes': ['error', 'single', { + allowTemplateLiterals: 'always' + }], + '@stylistic/quote-props': ['error', 'as-needed'], + '@stylistic/semi': ['error', 'always'], + '@stylistic/semi-spacing': 'error', + '@stylistic/space-before-blocks': 'error', + '@stylistic/space-before-function-paren': ['error', { + anonymous: 'never', + named: 'never', + asyncArrow: 'always', + catch: 'never' + }], + '@stylistic/space-infix-ops': 'error', + '@stylistic/space-in-parens': ['error', 'never'] + } } -}; +]; diff --git a/jsdoc.js b/jsdoc.js index da2d3c8..04efb3b 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -1,26 +1,32 @@ -module.exports = { - plugins: ['jsdoc'], - rules: { - // Enable once eslint 8 related issue is fixed: - // https://github.com/eslint/eslint/issues/14745 - //'jsdoc/check-examples': 1, - 'jsdoc/check-param-names': 1, - 'jsdoc/check-tag-names': 1, - 'jsdoc/check-types': 1, - 'jsdoc/tag-lines': ['error', 'any', {startLines: 1}], - 'jsdoc/no-undefined-types': 1, - 'jsdoc/require-description': 0, - 'jsdoc/require-description-complete-sentence': 1, - 'jsdoc/require-example': 0, - 'jsdoc/require-hyphen-before-param-description': 1, - 'jsdoc/require-param': 1, - 'jsdoc/require-param-description': 1, - 'jsdoc/require-param-name': 1, - 'jsdoc/require-param-type': 1, - 'jsdoc/require-returns': 1, - 'jsdoc/require-returns-check': 0, - 'jsdoc/require-returns-description': 1, - 'jsdoc/require-returns-type': 1, - 'jsdoc/valid-types': 1, +import jsdoc from 'eslint-plugin-jsdoc'; + +export default [ + { + plugins: { + jsdoc + }, + rules: { + // Enable once eslint 8 related issue is fixed: + // https://github.com/eslint/eslint/issues/14745 + //'jsdoc/check-examples': 1, + 'jsdoc/check-param-names': 1, + 'jsdoc/check-tag-names': 1, + 'jsdoc/check-types': 1, + 'jsdoc/tag-lines': ['error', 'any', {startLines: 1}], + 'jsdoc/no-undefined-types': 1, + 'jsdoc/require-description': 0, + 'jsdoc/require-description-complete-sentence': 1, + 'jsdoc/require-example': 0, + 'jsdoc/require-hyphen-before-param-description': 1, + 'jsdoc/require-param': 1, + 'jsdoc/require-param-description': 1, + 'jsdoc/require-param-name': 1, + 'jsdoc/require-param-type': 1, + 'jsdoc/require-returns': 1, + 'jsdoc/require-returns-check': 0, + 'jsdoc/require-returns-description': 1, + 'jsdoc/require-returns-type': 1, + 'jsdoc/valid-types': 1 + } } -}; +]; diff --git a/module.js b/module.js index 86074de..d145ec5 100644 --- a/module.js +++ b/module.js @@ -1,14 +1,17 @@ -module.exports = { - env: { - es2020: true - }, - parserOptions: { - sourceType: 'module' - }, - plugins: [ - 'unicorn' - ], - rules: { - 'unicorn/prefer-module': 'error' +import eslintPluginUnicorn from 'eslint-plugin-unicorn'; + +export default [ + //eslintPluginUnicorn.configs['flat/recommended'], + { + languageOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + plugins: { + unicorn: eslintPluginUnicorn + }, + rules: { + 'unicorn/prefer-module': 'error' + } } -}; +]; diff --git a/package.json b/package.json index 96db889..56ec0f8 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,28 @@ "name": "eslint-config-digitalbazaar", "version": "5.2.1-0", "description": "Digital Bazaar's eslint rules", - "main": "index.js", + "type": "module", + "main": "./index.js", + "exports": { + ".": "./index.js", + "./jsdoc": "./jsdoc.js", + "./module": "./module.js", + "./vue2": "./vue2.js", + "./vue3": "./vue3.js" + }, "files": [ - "[a-z]*.js", - "templates/**/[a-z]*.js" + "import.js", + "index.js", + "jsdoc.js", + "module.js", + "vue-common.js", + "vue2.js", + "vue3.js", + "templates/**/*.js" ], "scripts": { - "test": "eslint -c index.js **/*.js", - "lint": "eslint -c index.js --ignore-pattern test/index.js **/*.js" + "test": "eslint", + "lint": "eslint --ignore-pattern 'test/**/*.js'" }, "repository": { "type": "git", @@ -30,16 +44,23 @@ }, "homepage": "https://github.com/digitalbazaar/eslint-config-digitalbazaar#readme", "devDependencies": { - "eslint": "^8.14.0", - "eslint-plugin-eslint-plugin": "^4.1.0" + "@stylistic/eslint-plugin-migrate": "^4.4.1", + "eslint": "^9.32.0", + "eslint-plugin-eslint-plugin": "^7.0.0", + "eslint-plugin-import": "^2.32.0" }, "peerDependencies": { - "eslint": "^8.14.0", - "eslint-plugin-jsdoc": ">=42.0.0" + "eslint": "^9.32.0", + "eslint-plugin-jsdoc": "^52.0.4" }, "peerDependenciesMeta": { "eslint-plugin-jsdoc": { "optional": true } + }, + "dependencies": { + "@eslint/js": "^9.33.0", + "@stylistic/eslint-plugin": "^5.2.3", + "globals": "^16.3.0" } } diff --git a/templates/all.js b/templates/all.js index 7598e14..a57f09f 100644 --- a/templates/all.js +++ b/templates/all.js @@ -1,7 +1,11 @@ -module.exports = { - extends: [ - 'digitalbazaar', - 'digitalbazaar/jsdoc', - 'digitalbazaar/vue' - ] -}; +import digitalbazaar from 'eslint-config-digitalbazaar'; +import digitalbazaarJsdoc from 'eslint-config-digitalbazaar/jsdoc'; +import digitalbazaarModule from 'eslint-config-digitalbazaar/module'; +import digitalbazaarVue3 from 'eslint-config-digitalbazaar/vue3'; + +export default [ + ...digitalbazaar, + ...digitalbazaarJsdoc, + ...digitalbazaarModule, + ...digitalbazaarVue3 +]; diff --git a/templates/node.js b/templates/node.js index b7680b1..52c2f7b 100644 --- a/templates/node.js +++ b/templates/node.js @@ -1,8 +1,13 @@ -module.exports = { - env: { - node: true +import digitalbazaar from 'eslint-config-digitalbazaar'; +import globals from 'globals'; + +export default [ + { + languageOptions: { + globals: { + ...globals.node + } + } }, - extends: [ - 'digitalbazaar' - ] -}; + ...digitalbazaar +]; diff --git a/templates/vue.js b/templates/vue.js deleted file mode 100644 index 5b93428..0000000 --- a/templates/vue.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - env: { - browser: true - }, - extends: [ - 'digitalbazaar', - 'digitalbazaar/vue' - ] -}; diff --git a/templates/vue2.js b/templates/vue2.js new file mode 100644 index 0000000..47b727d --- /dev/null +++ b/templates/vue2.js @@ -0,0 +1,15 @@ +import digitalbazaar from 'eslint-config-digitalbazaar'; +import digitalbazaarVue from 'eslint-config-digitalbazaar/vue2'; +import globals from 'globals'; + +export default [ + { + languageOptions: { + globals: { + ...globals.browser + } + } + }, + ...digitalbazaar, + ...digitalbazaarVue +]; diff --git a/templates/vue3.js b/templates/vue3.js index 7fd0893..b61f21e 100644 --- a/templates/vue3.js +++ b/templates/vue3.js @@ -1,9 +1,15 @@ -module.exports = { - env: { - browser: true +import digitalbazaar from 'eslint-config-digitalbazaar'; +import digitalbazaarVue3 from 'eslint-config-digitalbazaar/vue3'; +import globals from 'globals'; + +export default [ + { + languageOptions: { + globals: { + ...globals.browser + } + } }, - extends: [ - 'digitalbazaar', - 'digitalbazaar/vue3' - ] -}; + ...digitalbazaar, + ...digitalbazaarVue3 +]; diff --git a/test/imports/.eslintrc.cjs b/test/imports/.eslintrc.cjs deleted file mode 100644 index 66c49e9..0000000 --- a/test/imports/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - env: { - es6: true - }, - extends: [ - '../../import.js' - ] -}; diff --git a/test/imports/package.json b/test/imports/package.json deleted file mode 100644 index 0f0dab4..0000000 --- a/test/imports/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "imports", - "version": "1.0.0", - "description": "For use testing es6 import related linting rules.", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "devDependencies": { - "eslint-plugin-import": "^2.26.0" - } -} diff --git a/vue-common.js b/vue-common.js index 8741258..3a0d8c6 100644 --- a/vue-common.js +++ b/vue-common.js @@ -1,13 +1,20 @@ // common for all vue versions -module.exports = { - env: { - browser: true - }, - rules: { - 'vue/mustache-interpolation-spacing': ['error', 'never'], - 'vue/html-closing-bracket-newline': ['error', { - singleline: 'never', - multiline: 'never' - }] +import globals from 'globals'; + +export default [ + { + files: ['**/*.vue'], + languageOptions: { + globals: { + ...globals.browser + } + }, + rules: { + 'vue/mustache-interpolation-spacing': ['error', 'never'], + 'vue/html-closing-bracket-newline': ['error', { + singleline: 'never', + multiline: 'never' + }] + } } -}; +]; diff --git a/vue.js b/vue.js deleted file mode 100644 index a666474..0000000 --- a/vue.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - extends: [ - 'plugin:vue/recommended', - 'digitalbazaar/vue-common' - ] -}; diff --git a/vue2.js b/vue2.js new file mode 100644 index 0000000..2c8a296 --- /dev/null +++ b/vue2.js @@ -0,0 +1,7 @@ +import pluginVue from 'eslint-plugin-vue'; +import vueCommon from './vue-common.js'; + +export default [ + ...pluginVue.configs['flat/vue2-recommended'], + ...vueCommon +]; diff --git a/vue3.js b/vue3.js index caff6f7..8dfd8f4 100644 --- a/vue3.js +++ b/vue3.js @@ -1,6 +1,7 @@ -module.exports = { - extends: [ - 'plugin:vue/vue3-recommended', - 'digitalbazaar/vue-common' - ] -}; +import pluginVue from 'eslint-plugin-vue'; +import vueCommon from './vue-common.js'; + +export default [ + ...pluginVue.configs['flat/recommended'], + ...vueCommon +];