index.ts
const m = require("./test");
console.log(m.a);
test.ts
module.exports = {
a: 1,
b: 2,
};
After compilation
index.js
var m = require("./test");
console.log(m.a);
test.js
module.exports = {
a: 1,
b: 2
};
The module specified in tsconfig.json is ES6. It should be compiled into a modular way such as import {a} from 'test'. Why is it still the modular way of commonjs?

TypeScript can transpile ES6 (and TypeScript specific) module syntax into an arbitrary module syntax.
It cannot do it the other way round. Write modern code without require and module.exports.