diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..87f877b28 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf diff --git a/package.json b/package.json index fa870f66c..9491ac60e 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,14 @@ "prettier:diff": "yarn nit:source", "lint-heading-ids": "node scripts/headingIdLinter.js", "fix-headings": "node scripts/headingIdLinter.js --fix", - "ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss", + "ci-check": "npm-run-all prettier:diff --parallel lint tsc lint-heading-ids rss lint-editorconfig", "tsc": "tsc --noEmit", "start": "next start", "postinstall": "patch-package && (is-ci || husky install .husky)", "check-all": "npm-run-all prettier lint:fix tsc rss", "rss": "node scripts/generateRss.js", "cache-reset": "rm -rf node_modules/.cache && rm -rf .next && yarn cache clean", + "lint-editorconfig": "yarn editorconfig-checker", "textlint-test": "yarn mocha ./textlint/tests/utils && yarn mocha ./textlint/tests/rules", "textlint-docs": "node ./textlint/generators/genTranslateGlossaryDocs.js && git add wiki/translate-glossary.md", "textlint-lint": "yarn textlint ./src/content --rulesdir ./textlint/rules -f pretty-error" @@ -65,6 +66,7 @@ "asyncro": "^3.0.0", "autoprefixer": "^10.4.2", "babel-eslint": "10.x", + "editorconfig-checker": "^6.0.0", "eslint": "7.x", "eslint-config-next": "12.0.3", "eslint-config-react-app": "^5.2.1", @@ -115,6 +117,7 @@ "showDetails": true }, "lint-staged": { + "*": "yarn editorconfig-checker", "*.{js,ts,jsx,tsx,css}": "yarn prettier", "src/**/*.md": [ "yarn fix-headings", diff --git a/yarn.lock b/yarn.lock index 4f186e5bf..6be6095b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2715,6 +2715,11 @@ eastasianwidth@^0.2.0: resolved "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== +editorconfig-checker@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/editorconfig-checker/-/editorconfig-checker-6.0.0.tgz#f9bdcbd13411aab9a208030f88051add97bff2f6" + integrity sha512-uyTOwLJzR/k7ugiu7ITjCzkLKBhXeirQZ8hGlUkt1u/hq2Qu1E8EslgFZDN+lxZoQc97eiI87sUFgVILK4P+YQ== + ee-first@1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"