зеркало из https://github.com/microsoft/tiny-calc.git
Add lint
This commit is contained in:
Родитель
050acaa786
Коммит
00844a56a4
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"eslint.workingDirectories": [{ "mode": "auto" }],
|
||||
"files.exclude": {
|
||||
".git": true,
|
||||
"**/.DS_Store": true,
|
||||
"common/temp": true,
|
||||
}
|
||||
}
|
|
@ -18,6 +18,13 @@
|
|||
"safeForSimultaneousRushProcesses": false,
|
||||
"enableParallelism": true,
|
||||
},
|
||||
{
|
||||
"commandKind": "bulk",
|
||||
"name": "lint",
|
||||
"summary": "Execute lint script for all packages",
|
||||
"safeForSimultaneousRushProcesses": false,
|
||||
"enableParallelism": true,
|
||||
},
|
||||
// {
|
||||
// /**
|
||||
// * (Required) Determines the type of custom command.
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,2 @@
|
|||
# NPM dependencies
|
||||
/node_modules
|
|
@ -0,0 +1,22 @@
|
|||
// This is a workaround for https://github.com/eslint/eslint/issues/3458
|
||||
require('@rushstack/eslint-config/patch/modern-module-resolution');
|
||||
|
||||
module.exports = {
|
||||
extends: ["@rushstack/eslint-config"],
|
||||
overrides: [{
|
||||
// Declare an override that applies to TypeScript files only
|
||||
files: ['*.ts', '*.tsx'],
|
||||
rules: {
|
||||
// RATIONALE: Not concerned about readability for non-TypeScript developers. (Harmless)
|
||||
'@typescript-eslint/no-parameter-properties': 'off',
|
||||
|
||||
// RATIONALE: Underscore prefixes are not common practice for TS/JS devs, but we allow them when
|
||||
// needed to prevent collisions between public/private accessors.
|
||||
// Docs: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{ selector: 'accessor', modifiers: ['private'], format: ['camelCase'], "leadingUnderscore": "allow" },
|
||||
],
|
||||
}
|
||||
}]
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "@tiny-calc/eslint-config",
|
||||
"version": "0.0.0-alpha.5",
|
||||
"main": "index.js",
|
||||
"description": "Common ESLint config",
|
||||
"sideEffects": "false",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url" : "https://github.com/microsoft/plasma.git"
|
||||
},
|
||||
"author": "Microsoft",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "echo No build steps necessary.",
|
||||
"lint": "echo No lint steps necessary.",
|
||||
"test": "echo No test steps necessary."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-config": "^1.0.2"
|
||||
}
|
||||
}
|
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
"name": "@tiny-calc/tool-config",
|
||||
"name": "@tiny-calc/ts-config",
|
||||
"version": "0.0.0-alpha.5",
|
||||
"description": "Common config for build tools",
|
||||
"description": "Common TypeScript config",
|
||||
"sideEffects": "false",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/tiny-calc.git"
|
||||
"url" : "https://github.com/microsoft/plasma.git"
|
||||
},
|
||||
"author": "Microsoft",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "echo No build steps necessary.",
|
||||
"lint": "echo No lint steps necessary.",
|
||||
"test": "echo No test steps necessary."
|
||||
}
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"target": "ES2019",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"lib": ["es2019"],
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"sourceMap": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
"extends": [ "@tiny-calc/eslint-config" ],
|
||||
parserOptions: {
|
||||
project: './tsconfig.eslint.json',
|
||||
},
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
"build": "tsc",
|
||||
"clean": "rimraf ./dist *.build.log",
|
||||
"dev": "npm run build -- --watch",
|
||||
"lint": "eslint --ext=ts --format visualstudio src",
|
||||
"prof": "tsc --project tsconfig.prof.json && node --prof temp/bench/profile.js && node --prof-process isolate-*-v8.log > profile.log && rm isolate-*-v8.log",
|
||||
"test": "mocha -r ts-node/register test/**/*.spec.ts",
|
||||
"adjust-random": "ts-node test/random-adjust-tree.ts"
|
||||
|
@ -22,14 +23,16 @@
|
|||
"@tiny-calc/nano": "0.0.0-alpha.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tiny-calc/tool-config": "0.0.0-alpha.5",
|
||||
"@tiny-calc/eslint-config": "0.0.0-alpha.5",
|
||||
"@tiny-calc/ts-config": "0.0.0-alpha.5",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"@types/node": "^10.0.0",
|
||||
"@types/node": "^12.12.54",
|
||||
"best-random": "^1.0.3",
|
||||
"eslint": "^7.7.0",
|
||||
"hotloop": "^1.0.0",
|
||||
"mocha": "^6.1.4",
|
||||
"rimraf": "^2.6.3",
|
||||
"ts-node": "^8.1.0",
|
||||
"typescript": "^3.8.2"
|
||||
"typescript": "^3.9.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
ValueCell
|
||||
} from "./types";
|
||||
|
||||
import * as assert from "assert";
|
||||
import { strict as assert } from "assert";
|
||||
|
||||
function valueCell(content: Primitive): ValueCell {
|
||||
return { state: CalcState.Clean, content };
|
||||
|
|
|
@ -43,7 +43,7 @@ import {
|
|||
Value,
|
||||
} from "./types";
|
||||
|
||||
import * as assert from "assert";
|
||||
import { strict as assert } from "assert";
|
||||
|
||||
function assertNever(_: never) {
|
||||
return assert.fail(`
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
// extend your base config so you don't have to redefine your compilerOptions
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"test/**/*.ts",
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "@tiny-calc/tool-config/tsconfig.json",
|
||||
"extends": "@tiny-calc/ts-config/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declarationDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "@tiny-calc/tool-config/tsconfig.json",
|
||||
"extends": "@tiny-calc/ts-config/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declarationDir": "./temp",
|
||||
"rootDir": ".",
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
"extends": [ "@tiny-calc/eslint-config" ],
|
||||
parserOptions: {
|
||||
project: './tsconfig.eslint.json',
|
||||
},
|
||||
}
|
|
@ -14,17 +14,20 @@
|
|||
"build": "tsc",
|
||||
"clean": "rimraf ./dist *.build.log",
|
||||
"dev": "npm run build -- --watch",
|
||||
"lint": "eslint --ext=ts --format visualstudio src",
|
||||
"test": "mocha -r ts-node/register test/**/*.spec.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tiny-calc/tool-config": "0.0.0-alpha.5",
|
||||
"@tiny-calc/eslint-config": "0.0.0-alpha.5",
|
||||
"@tiny-calc/ts-config": "0.0.0-alpha.5",
|
||||
"eslint": "^7.7.0",
|
||||
"@types/benchmark": "^1.0.31",
|
||||
"@types/mocha": "^5.2.6",
|
||||
"@types/node": "^10.0.0",
|
||||
"@types/node": "^12.12.54",
|
||||
"benchmark": "^2.1.4",
|
||||
"mocha": "^6.1.4",
|
||||
"rimraf": "^2.6.3",
|
||||
"ts-node": "^8.1.0",
|
||||
"typescript": "^3.8.2"
|
||||
"typescript": "^3.9.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
TypeName
|
||||
} from "../src/index";
|
||||
import { createObjFromMap, createReadMap, createRefMap } from "./util/objectTypes";
|
||||
import * as assert from "assert";
|
||||
import { strict as assert } from "assert";
|
||||
import "mocha";
|
||||
|
||||
const astSink: ExpAlgebra<object> = {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
// extend your base config so you don't have to redefine your compilerOptions
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"test/**/*.ts",
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "@tiny-calc/tool-config/tsconfig.json",
|
||||
"extends": "@tiny-calc/ts-config/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declarationDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
"extends": [ "@tiny-calc/eslint-config" ],
|
||||
parserOptions: {
|
||||
project: './tsconfig.eslint.json',
|
||||
},
|
||||
}
|
|
@ -12,6 +12,7 @@
|
|||
"build": "tsc",
|
||||
"clean": "rimraf ./dist *.build.log",
|
||||
"dev": "npm run build -- --watch",
|
||||
"lint": "eslint --ext=ts --format visualstudio src",
|
||||
"test": "ts-node src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -19,10 +20,11 @@
|
|||
"node-fetch": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tiny-calc/tool-config": "0.0.0-alpha.5",
|
||||
"@types/node": "^10.0.0",
|
||||
"@tiny-calc/eslint-config": "0.0.0-alpha.5",
|
||||
"@tiny-calc/ts-config": "0.0.0-alpha.5",
|
||||
"@types/node": "^12.12.54",
|
||||
"rimraf": "^2.6.3",
|
||||
"ts-node": "^8.1.0",
|
||||
"typescript": "^3.8.2"
|
||||
"typescript": "^3.9.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
// extend your base config so you don't have to redefine your compilerOptions
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"test/**/*.ts",
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "@tiny-calc/tool-config/tsconfig.json",
|
||||
"extends": "@tiny-calc/ts-config/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declarationDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
|
|
20
rush.json
20
rush.json
|
@ -11,11 +11,23 @@
|
|||
"strictPeerDependencies": true
|
||||
},
|
||||
"ensureConsistentVersions": true,
|
||||
"projectFolderMaxDepth": 3,
|
||||
"projectFolderMaxDepth": 4,
|
||||
"repository": {
|
||||
"url": "https://github.com/microsoft/tiny-calc.git"
|
||||
},
|
||||
"projects": [
|
||||
{
|
||||
"packageName": "@tiny-calc/eslint-config",
|
||||
"projectFolder": "packages/common/config/eslint-config",
|
||||
"reviewCategory": "production",
|
||||
"versionPolicyName": "public"
|
||||
},
|
||||
{
|
||||
"packageName": "@tiny-calc/ts-config",
|
||||
"projectFolder": "packages/common/config/ts-config",
|
||||
"reviewCategory": "production",
|
||||
"versionPolicyName": "public"
|
||||
},
|
||||
{
|
||||
"packageName": "@tiny-calc/micro",
|
||||
"projectFolder": "packages/core/micro",
|
||||
|
@ -28,12 +40,6 @@
|
|||
"reviewCategory": "production",
|
||||
"versionPolicyName": "public"
|
||||
},
|
||||
{
|
||||
"packageName": "@tiny-calc/tool-config",
|
||||
"projectFolder": "packages/common/tool-config",
|
||||
"reviewCategory": "production",
|
||||
"versionPolicyName": "public"
|
||||
},
|
||||
{
|
||||
"packageName": "@tiny-calc-test/example",
|
||||
"projectFolder": "packages/test/example",
|
||||
|
|
Загрузка…
Ссылка в новой задаче