Skip to content

Commit

Permalink
chore(frontend): configure linting for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Sep 20, 2024
1 parent 499f2be commit e7970af
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 40 deletions.
112 changes: 101 additions & 11 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,107 @@
"use-strict";

module.exports = {
extends: ["@adfinis/eslint-config/ember-app"],
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
},
plugins: ["ember", "@typescript-eslint", "import"],
extends: [
"eslint:recommended",
"plugin:ember/recommended",
"plugin:prettier/recommended",
],
env: {
browser: true,
},
rules: {
"ember/no-actions-hash": "warn",
"ember/no-component-lifecycle-hooks": "warn",
"ember/no-mixins": "warn",
"ember/no-new-mixins": "warn",
"ember/no-classic-classes": "warn",
"ember/no-classic-components": "warn",
"ember/no-get": "warn",
"ember/no-observers": "warn",
"qunit/no-assert-equal": "warn",
"ember/require-tagless-components": "warn",
// possible errors
"no-await-in-loop": "error",

// best practices
"array-callback-return": "error",
"dot-notation": "error",
eqeqeq: "error",
"no-alert": "error",
"no-else-return": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-floating-decimal": "error",
"one-var": ["error", "never"],
curly: ["error", "multi-line"],

// ES6
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-destructuring": [
"error",
{ AssignmentExpression: { array: false, object: false } },
],
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",

// import
"import/no-duplicates": "error",
"import/no-unresolved": "off",
"import/order": [
"error",
{
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],

// tooling
"no-console": ["error", { allow: ["warn", "error"] }],
"no-debugger": "error",
},
overrides: [
// js files
{
files: ["**/*.js"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {},
},
// ts files
{
files: ["**/*.ts"],
extends: [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {},
},
// node files
{
files: [
"./.eslintrc.js",
"./.prettierrc.js",
"./.stylelintrc.js",
"./.template-lintrc.js",
"./ember-cli-build.js",
"./testem.js",
"./blueprints/*/index.js",
"./config/**/*.js",
"./lib/*/index.js",
"./server/**/*.js",
],
env: {
browser: false,
node: true,
},
extends: ["plugin:n/recommended"],
},
{
// test files
files: ["tests/**/*-test.{js,ts}"],
extends: ["plugin:qunit/recommended"],
},
],
};
30 changes: 1 addition & 29 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e7970af

Please sign in to comment.