diff --git a/src/generators/default-content/templates/configured/_package.json b/src/generators/default-content/templates/configured/_package.json index f085c38..41e40f4 100644 --- a/src/generators/default-content/templates/configured/_package.json +++ b/src/generators/default-content/templates/configured/_package.json @@ -5,15 +5,15 @@ "repository": "https://github.com/<%= githubOrg %>/<%= hyphenatedName %>.git", "scripts": { "lint": "npm run lint:eslint && npm run lint:style", - "lint:eslint": "eslint . --ext .js,.html", + "lint:eslint": "eslint .", "lint:style": "stylelint \"**/*.{js,html}\"" }, "author": "D2L Corporation", "license": "Apache-2.0", "devDependencies": { "@brightspace-ui/stylelint-config": "^1", - "eslint": "^8", - "eslint-config-brightspace": "^1", + "eslint": "^9", + "eslint-config-brightspace": "^2", "stylelint": "^16" }, "files": [ diff --git a/src/generators/default-content/templates/static/eslint.config.js b/src/generators/default-content/templates/static/eslint.config.js new file mode 100644 index 0000000..ddc04d7 --- /dev/null +++ b/src/generators/default-content/templates/static/eslint.config.js @@ -0,0 +1,8 @@ +import { addExtensions, litConfig, setDirectoryConfigs, testingConfig } from 'eslint-config-brightspace'; + +export default setDirectoryConfigs( + addExtensions(litConfig, ['.js', '.html']), + { + test: testingConfig + } +); diff --git a/src/generators/test-unit-axe/index.js b/src/generators/test-unit-axe/index.js index ec62b40..abcf6bd 100644 --- a/src/generators/test-unit-axe/index.js +++ b/src/generators/test-unit-axe/index.js @@ -34,10 +34,6 @@ export function run(templateData) { ); } - copyFile( - `${__dirname}/templates/static/test/.eslintrc.json`, - `${getDestinationPath(templateData.hyphenatedName)}/test/.eslintrc.json` - ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.test.js`, templateData); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/test/${templateData.hyphenatedName}.axe.js`, templateData); sortJSONMembers(`${getDestinationPath(templateData.hyphenatedName)}/package.json`, ['dependencies', 'devDependencies']); diff --git a/src/generators/test-unit-axe/templates/static/test/.eslintrc.json b/src/generators/test-unit-axe/templates/static/test/.eslintrc.json deleted file mode 100644 index 9c6a0b6..0000000 --- a/src/generators/test-unit-axe/templates/static/test/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "brightspace/testing-config" -} diff --git a/src/generators/wc-lit-element/index.js b/src/generators/wc-lit-element/index.js index 62f6c16..023aa86 100644 --- a/src/generators/wc-lit-element/index.js +++ b/src/generators/wc-lit-element/index.js @@ -1,4 +1,4 @@ -import { copyFile, copyFilesInDir, getDestinationPath, mergeJSON, replaceText, sortJSONMembers } from '../../helper.js'; +import { copyFile, getDestinationPath, mergeJSON, replaceText, sortJSONMembers } from '../../helper.js'; export function run(templateData) { mergeJSON( @@ -19,6 +19,5 @@ export function run(templateData) { ); replaceText(`${getDestinationPath(templateData.hyphenatedName)}/${templateData.hyphenatedName}.js`, templateDataElement); - copyFilesInDir(`${__dirname}/templates/static`, getDestinationPath(templateData.hyphenatedName)); sortJSONMembers(`${getDestinationPath(templateData.hyphenatedName)}/package.json`, ['dependencies', 'devDependencies']); } diff --git a/src/generators/wc-lit-element/templates/static/.eslintrc.json b/src/generators/wc-lit-element/templates/static/.eslintrc.json deleted file mode 100644 index d5cc9f3..0000000 --- a/src/generators/wc-lit-element/templates/static/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "brightspace/lit-config" -}