/
githubmirror
/
oppia
Обзор
Документация
Войти
/
githubmirror
/
oppia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
.eslintrc
436 строк
12 KB
tanmaygoyal2007
Fix #23901: Removed tslint and apply eslint (#26598)
29 июл 2026, 14:52
Не верифицирован
29 июл 2026, 14:52
109d0bb
Код
Авторство
О чём код?
{ "parser": "@typescript-eslint/parser", "parserOptions": { "sourceType": "module" }, "extends": [ "eslint:recommended", "prettier" ], "plugins": [ "html", "unused-imports", "@typescript-eslint", "oppia", "@angular-eslint", "@angular-eslint/template" ], "overrides": [ { // We exclude test files from dependency injection format checks because // they are never minified. Also, we exclude no-loss-of-precision check as // it is only relevant for non-test files, since when running // frontend tests there is no loss of precision. "files": ["*Spec.js","*.spec.ts"], "rules": { "no-loss-of-precision": "off" } }, { "files": ["*.js", "*.ts"], "excludedFiles": [ "complete.spec.ts", "student.spec.ts", "teacher.spec.ts" ], "rules": { "oppia/no-to-throw": "error" } }, { // We only run the e2e action checks on end-to-end test files, and // we exclude files that we haven't fixed yet. "files": [ "core/tests/webdriverio/*.js", "core/tests/webdriverio_utils/*.js", "core/tests/webdriverio_desktop/*.js" ], "excludedFiles": [ "ClassroomPage.js", "DeleteAccountPage.js", "ExplorationEditorHistoryTab.js", "ExplorationEditorMainTab.js", "ExplorationEditorPage.js", "ExplorationEditorSettingsTab.js", "ExplorationEditorStatsTab.js", "ExplorationEditorTranslationTab.js", "GetStartedPage.js", "LearnerDashboardPage.js", "LibraryPage.js", "ProfilePage.js", "SkillEditorPage.js", "StoryEditorPage.js", "SubscriptionDashboardPage.js", "ThanksPage.js", "TopicAndStoryViewerPage.js", "TopicEditorPage.js", "TopicsAndSkillsDashboardPage.js", "action.js", "forms.js", "general.js", "users.js", "waitFor.js", "workflow.js", "additionalEditorFeatures.js", "additionalPlayerFeatures.js", "adminTabFeatures.js", "classroomPage.js", "collections.js", "contributorDashboard.js", "coreEditorAndPlayerFeatures.js", "creatorDashboard.js", "embedding.js", "explorationFeedbackTab.js", "explorationHistoryTab.js", "explorationImprovementsTab.js", "explorationStatisticsTab.js", "explorationTranslationTab.js", "extensions.js", "fileUploadExtensions.js", "learnerDashboard.js", "navigation.js", "playVoiceovers.js", "preferences.js", "profileFeatures.js", "publicationAndLibrary.js", "skillEditor.js", "topicAndStoryEditor.js", "topicAndStoryEditorFileUploadFeatures.js", "topicAndStoryViewer.js", "topicsAndSkillsDashboard.js", "userJourneys.js", "voiceoverUploadFeatures.js", "wipeout.js", "accessibility.js", "learnerFlow.js", "libraryFlow.js", "profileMenuFlow.js", "excludedForTesting.js" ], "rules": { "oppia/e2e-action": "error" } }, { // We only run the e2e practices checks on webdriverio // end-to-end test files. "files": [ "core/tests/webdriverio/*.js", "core/tests/webdriverio_utils/*.js", "core/tests/webdriverio_desktop/*.js" ], "rules": { "oppia/e2e-practices": "error" } }, { // We exclude spec files from the no-testonly check "files": ["*spec.js", "*spec.ts"], "rules": { "oppia/no-testonly": "off" } }, { "files": ["*.js", "*.ts"], "excludedFiles": [ "Polyfills.ts", "ck-editor-copy-content.service.spec.ts", "mathjax.directive.ts", "math-expression-content-editor.component.ts", "core/tests/*" ], "rules": { "oppia/no-inner-html": "error" } }, { "files": ["*.js", "*.ts"], "excludedFiles": [ "core/tests/**" ], "rules": { "oppia/no-relative-import": "error" } }, { "files": ["*.ts"], "rules": { "@angular-eslint/component-class-suffix": "warn", "@angular-eslint/contextual-lifecycle": "error", "@angular-eslint/directive-class-suffix": "error", "@angular-eslint/no-conflicting-lifecycle": "error", "@angular-eslint/no-empty-lifecycle-method": "warn", "@angular-eslint/no-host-metadata-property": "error", "@angular-eslint/no-input-rename": "error", "@angular-eslint/no-inputs-metadata-property": "error", "@angular-eslint/no-output-native": "warn", "@angular-eslint/no-output-on-prefix": "warn", "@angular-eslint/no-output-rename": "error", "@angular-eslint/no-outputs-metadata-property": "error", "@angular-eslint/use-lifecycle-interface": "warn", "@angular-eslint/use-pipe-transform-interface": "error", "@angular-eslint/component-selector": [ "warn", { "type": "element", "prefix": "oppia", "style": "kebab-case" } ], "@angular-eslint/directive-selector": [ "warn", { "type": "attribute", "prefix": "oppia", "style": "camelCase" } ] } }, { "files": ["*.component.html", "*.directive.html"], "extends": [ "plugin:@angular-eslint/template/recommended" ], "rules": { "max-len": ["error", { "code": 140 }] } } ], "rules": { "oppia/constant-declaration": "error", "oppia/comment-style": "error", "oppia/disallow-flags": "error", "oppia/disallow-httpclient": "error", "oppia/import-lodash": "error", "oppia/no-multiple-component": "error", "oppia/no-multiline-disable": "error", "oppia/no-testonly": "error", "oppia/test-message-style": "error", "oppia/no-test-blockers": "error", "oppia/no-bypass-security-phrase": "error", "oppia/no-view-encapsulation-none": "error", "array-bracket-spacing": [ "error", "never" ], "camelcase": [ "error", { "properties": "never" } ], "capitalized-comments": [ "error", "always", { "ignorePattern": "disable-bad-pattern-check|fall-through", "ignoreConsecutiveComments": true } ], "curly": [ "error", "all" ], "dot-notation": [ "error", { "allowKeywords": true } ], "eol-last":[ "error", "always" ], "eqeqeq": [ "error", "always" ], "func-style": [ "error", "expression" ], "key-spacing": "error", "no-compare-neg": "off", "no-console": [ "error", { "allow": [ "error", "warn" ] } ], "no-constant-condition": [ "off" ], "no-empty": [ "error", { "allowEmptyCatch": true } ], "no-multi-spaces": [ "error" ], "no-multi-str": [ "error" ], "no-prototype-builtins": "off", "no-redeclare": [ "off" ], "no-restricted-globals": [ "error", "addEventListener", "blur", "close", "closed", "confirm", "defaultStatus", "event", "external", "defaultstatus", "find", "focus", "frameElement", "frames", "history", "innerHeight", "innerWidth", "length", "location", "locationbar", "menubar", "moveBy", "moveTo", "name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload", "open", "opener", "opera", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "print", "removeEventListener", "resizeBy", "resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY", "scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY", "self", "sessionStorage", "status", "statusbar", "stop", "toolbar", "top"], "no-tabs": "error", "no-useless-escape": "off", "no-whitespace-before-property": "error", "no-trailing-spaces": [ "error" ], "no-undef": [ "off" ], "no-throw-literal": "error", "no-unused-vars": [ "off" ], "one-var": [ "off" ], "padded-blocks": [ "error", "never" ], "quotes": [ "off" ], // The following must be off so that we can enable // "@typescript-eslint/semi", which checks semicolons in TS files. "semi": "off", // The following must be off so that we can enable // "@typescript-eslint/no-extra-semi". "no-extra-semi": "off", "lines-between-class-members": "off", "semi-spacing": "error", "space-before-blocks": [ "error", "always" ], "spaced-comment": [ "error", "always" ], "space-in-parens": [ "error", "never" ], "space-infix-ops": [ "error" ], "space-unary-ops": [ "error", { "words": true, "nonwords": false } ], "switch-colon-spacing": [ "error", { "after": true, "before": false } ], "unused-imports/no-unused-imports-ts": "error", "@typescript-eslint/no-explicit-any": ["error"], "@typescript-eslint/semi": ["error"], "@typescript-eslint/ban-types": [ "error", { "types": { "String": { "message": "Use string instead.", "fixWith": "string" }, "Number": { "message": "Use number instead.", "fixWith": "number" }, "Boolean": { "message": "Use boolean instead.", "fixWith": "boolean" } }, "extendDefaults": false } ], "@typescript-eslint/array-type": [ "error", { "default": "array" } ], "@typescript-eslint/consistent-type-assertions": ["error"], "@typescript-eslint/consistent-type-definitions": ["error", "interface"], "@typescript-eslint/no-non-null-assertion": ["error"], "@typescript-eslint/no-non-null-asserted-optional-chain": ["error"], "@typescript-eslint/prefer-namespace-keyword": ["error"], "@typescript-eslint/triple-slash-reference": ["error"], "@typescript-eslint/adjacent-overload-signatures": ["error"], "@typescript-eslint/no-extra-non-null-assertion": ["error"], "@typescript-eslint/no-misused-new": ["error"], "@typescript-eslint/no-unused-vars": [ "error", { "args": "none", "varsIgnorePattern": "^_$" } ], "@typescript-eslint/explicit-module-boundary-types": ["error"], "@typescript-eslint/prefer-as-const": ["error"], "@typescript-eslint/no-array-constructor": ["error"], "@typescript-eslint/no-extra-semi": ["error"], "@typescript-eslint/type-annotation-spacing": ["error"], "wrap-iife": [ "error", "any" ], "@typescript-eslint/member-delimiter-style": ["error"], "@typescript-eslint/method-signature-style": ["error"], "@typescript-eslint/keyword-spacing": [ "error", { "before": true, "after": true } ], "@typescript-eslint/comma-spacing": [ "error", { "before": false, "after": true } ], "@typescript-eslint/quotes": [ "error", "single", { "avoidEscape": true } ], "no-dupe-class-members": "off", "@typescript-eslint/no-dupe-class-members": ["error"], "@typescript-eslint/no-namespace": ["error"] } }