Fail builds on new TypeScript errors

Test plan:
  - Run `yarn run check:ts` and see that it fails on new TypeScript errors

Future improvement needed:
  - Improve Gergich to parse TypeScript errors

Closes DE-1519

flag=none

Change-Id: I16a498794839753c0f6494f413480df954c55ad8
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/310200
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Aaron Ogata <aogata@instructure.com>
Build-Review: Aaron Ogata <aogata@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
This commit is contained in:
Aaron Shafovaloff 2023-02-02 10:00:44 -07:00
parent d14594a496
commit cec7be603b
148 changed files with 172 additions and 37 deletions

View File

@ -42,6 +42,7 @@ if [[ ! "${PRIVATE_PLUGINS[*]}" =~ "$GERRIT_PROJECT" ]]; then
ruby script/tatl_tael
fi
node_modules/.bin/tsc -p tsconfig.json --noEmit & TSC_PID=$!
ruby script/stylelint
ruby script/rlint --no-fail-on-offense
[ "${SKIP_ESLINT-}" != "true" ] && ruby script/eslint
@ -51,5 +52,6 @@ node ui-build/tools/component-info.mjs -i -v -g
bin/rails css:styleguide doc:api
wait $TSC_PID
gergich status
echo "LINTER OK!"

View File

@ -379,8 +379,8 @@
"build:js:watch": "yarn run webpack",
"build:packages": "yarn workspace-run build:canvas",
"check:js": "tsc --checkJs -p tsconfig.json",
"check:ts": "tsc -p tsconfig.json",
"check:ts:watch": "tsc --watch -p tsconfig.json",
"check:ts": "tsc -p tsconfig.json --noEmit",
"check:ts:watch": "tsc --watch -p tsconfig.json --noEmit",
"lint:staged": "lint-staged",
"lint:js:coffeescripts": "echo 'STOP CALLING ME IM NO LONGER NEEDED'",
"lint:js:jsx": "eslint ui --cache --ext '.js,.ts,.tsx'",

View File

@ -16,28 +16,28 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
export type PersistentArray = Array;
export type PersistentArray<T> = Array<T>
export type PersistentArrayParameters = {
// Where to store the value in localStorage. If a value is found at that key,
// it will be used as the initial value for the array.
key: string;
key: string
// Milliseconds to wait before persisting any batched writes. APIs that
// accept single elements, like push and pop, batch their writes to
// localStorage.
throttle: number;
throttle: number
// Maximum number of elements the array should contain. If a call to #push()
// would cause the array to exceed this boundary, a value will be shifted
// from the front first.
//
// Defaults to Infinity.
size: number;
size: number
// A hook to transform the value to make it more suitable for saving by the
// transform parameter. This only applies to the saved value and not for the
// one stored in memory.
//
// Don't mutate it!!!
transform: (Array) => Array;
};
transform: <T>(array: Array<T>) => Array<T>
}

View File

@ -4,7 +4,7 @@
"esModuleInterop": true, // more accurately transpiles to the ES6 module spec (maybe not needed w/ babel transpilation)
"isolatedModules": true, // required to adhere to babel's single-file transpilation process
"jsx": "react", // transpiles jsx to React.createElement calls (maybe not needed w/ babel transpilation)
"lib": ["dom", "es2020", "esnext"], // include types for DOM APIs and standard JS up to ES2020
"lib": ["DOM", "ES2020", "ESNext"], // include types for DOM APIs and standard JS up to ES2020
"module": "es2020", // support the most modern ES6-style module syntax
"moduleResolution": "node", // required for non-commonjs imports
"noEmit": true, // don't generate transpiled JS files, source-maps, or .d.ts files for Canvas source code

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2020 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2020 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*
@ -85,8 +86,6 @@ export const App: React.FC<ResponsiveComponentProps> = ({
pollForPublishStatus,
unpublishedChanges,
coursePace,
isSyncing,
isPacePublishing,
}) => {
const [trayOpen, setTrayOpen] = useState(false)

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2022 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*
@ -22,7 +23,6 @@ import {StoreState, UIState} from '../types'
import {Constants as UIConstants, UIAction} from '../actions/ui'
import {getCoursePaceType, getPacePublishing} from './course_paces'
import {getBlackoutDatesSyncing} from '../shared/reducers/blackout_dates'
import {Constants as CoursePaceConstants} from '../actions/course_paces'
export const initialState: UIState = {
autoSaving: false,

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2020 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2020 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2013 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2019 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2019 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2014 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2014 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2014 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -114,7 +114,7 @@ export function secondaryAndTertiarySort(
{asc = true}
) {
let result
result = localeSort(a.sortable_name, b.sortable_name, {asc})
result = localeSort(a.sortable_name || '', b.sortable_name || '', {asc})
if (result === 0) {
result = idSort(a, b, {asc})
}

View File

@ -4389,7 +4389,7 @@ class Gradebook extends React.Component<GradebookProps, GradebookState> {
)
}
showSimilarityScore = _assignment => !!this.options.show_similarity_score
showSimilarityScore = (_assignment: Assignment) => !!this.options.show_similarity_score
viewUngradedAsZero = () =>
!!(this.courseFeatures.allowViewUngradedAsZero && this.gridDisplaySettings.viewUngradedAsZero)

View File

@ -156,19 +156,14 @@ export default function GradebookData(props: Props) {
useEffect(() => {
if (gradingPeriodSet) {
fetchGradingPeriodAssignments()
.then(() => {
if (currentGradingPeriodId !== '0') {
loadAssignmentGroups(currentGradingPeriodId)
}
})
.catch(error => {
throw new Error('Failed to load grading period assignments', error)
})
} else {
loadAssignmentGroups().catch(error => {
throw new Error('Failed to load assignment groups', error)
// eslint-disable-next-line promise/catch-or-return
fetchGradingPeriodAssignments().then(() => {
if (currentGradingPeriodId !== '0') {
loadAssignmentGroups(currentGradingPeriodId)
}
})
} else {
loadAssignmentGroups()
}
}, [
gradingPeriodSet,

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2019 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2018 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -130,7 +130,7 @@ export default function FilterNav({
isSelected: appliedFilters.some(c => c.type === 'section' && c.value === a.id),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'section',
value: a.id,
created_at: new Date().toISOString(),
@ -154,7 +154,7 @@ export default function FilterNav({
isSelected: appliedFilters.some(c => c.type === 'module' && c.value === m.id),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'module',
value: m.id,
created_at: new Date().toISOString(),
@ -178,7 +178,7 @@ export default function FilterNav({
isSelected: appliedFilters.some(c => c.type === 'grading-period' && c.value === a.id),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'grading-period',
value: a.id,
created_at: new Date().toISOString(),
@ -203,7 +203,7 @@ export default function FilterNav({
isSelected: appliedFilters.some(c => c.type === 'assignment-group' && c.value === a.id),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'assignment-group',
value: a.id,
created_at: new Date().toISOString(),
@ -237,7 +237,7 @@ export default function FilterNav({
),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'student-group',
value: group.id,
created_at: new Date().toISOString(),
@ -264,7 +264,7 @@ export default function FilterNav({
),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'submissions',
value: 'has-ungraded-submissions',
created_at: new Date().toISOString(),
@ -280,7 +280,7 @@ export default function FilterNav({
),
onToggle: () => {
const filter: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'submissions',
value: 'has-submissions',
created_at: new Date().toISOString(),
@ -349,13 +349,13 @@ export default function FilterNav({
onCloseDateModal={() => setIsDateModalOpen(false)}
onSelectDates={(startDateValue, endDateValue) => {
const startDateCondition: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'start-date',
value: startDateValue,
created_at: new Date().toISOString(),
}
const endDateCondition: Filter = {
id: uuid(),
id: uuid.v4(),
type: 'end-date',
value: endDateValue,
created_at: new Date().toISOString(),

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2019 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2019 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2017 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2021 - present Instructure, Inc.
*

View File

@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (C) 2020 - present Instructure, Inc.
*

Some files were not shown because too many files have changed in this diff Show More