Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ es
dist
public
type-declarations
style
.vscode
coverage
dev-build
165 changes: 97 additions & 68 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,83 +15,112 @@ const compat = new FlatCompat({
allConfig: js.configs.all
});

export default [{
ignores: ["examples/webpack.dev.js", "**/.eslintrc.js", "**/babel.config.js"],
}, ...compat.extends("plugin:@typescript-eslint/recommended", "plugin:react/recommended"), {
plugins: {
"@typescript-eslint": typescriptEslint,
react,
export default [
{
ignores: [
"examples/webpack.dev.js",
"**/.eslintrc.js",
"**/babel.config.js",
"src/style/**",
"**/*.css",
],
},

languageOptions: {
globals: {
...globals.mocha,
...globals.browser,
...compat.extends(
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
),
{
plugins: {
"@typescript-eslint": typescriptEslint,
react,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "script",
languageOptions: {
globals: {
...globals.mocha,
...globals.browser,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
project: ["./tsconfig.json", "./src/visGeometry/workers/tsconfig.json"],
parserOptions: {
project: [
"./tsconfig.json",
"./src/visGeometry/workers/tsconfig.json",
],
},
},
},

settings: {
react: {
version: "detect",
settings: {
react: {
version: "detect",
},
},
},

rules: {
"@typescript-eslint/no-empty-object-type": ["warn"],
"@typescript-eslint/no-unsafe-function-type": ["warn"],
"@typescript-eslint/no-wrapper-object-types": ["warn"],
rules: {
"@typescript-eslint/no-empty-object-type": ["warn"],
"@typescript-eslint/no-unsafe-function-type": ["warn"],
"@typescript-eslint/no-wrapper-object-types": ["warn"],

"@typescript-eslint/naming-convention": ["warn", {
selector: "default",
format: ["camelCase", "PascalCase"],
}, {
selector: "variable",
format: ["camelCase", "UPPER_CASE", "PascalCase"],
}, {
selector: "property",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
}, {
selector: "property",
format: null,
filter: {
regex: "^[0-9]+$",
match: true,
}
}, {
selector: "typeLike",
format: ["PascalCase"],
}, {
selector: "interface",
format: ["PascalCase"],
}, {
selector: "enumMember",
format: ["UPPER_CASE"],
}, {
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
}],
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "default",
format: ["camelCase", "PascalCase"],
},
{
selector: "variable",
format: ["camelCase", "UPPER_CASE", "PascalCase"],
},
{
selector: "property",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
{
selector: "property",
format: null,
filter: {
regex: "^[0-9]+$",
match: true,
},
},
{
selector: "typeLike",
format: ["PascalCase"],
},
{
selector: "interface",
format: ["PascalCase"],
},
{
selector: "enumMember",
format: ["UPPER_CASE"],
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
},
],

"@typescript-eslint/indent": ["off"],
"@typescript-eslint/no-empty-function": ["warn"],
"@typescript-eslint/no-inferrable-types": ["warn"],
"@typescript-eslint/no-this-alias": ["warn"],
"prefer-const": ["warn"],
"prefer-spread": ["warn"],
"no-var": ["warn"],
"no-unused-vars": "off",
"@typescript-eslint/indent": ["off"],
"@typescript-eslint/no-empty-function": ["warn"],
"@typescript-eslint/no-inferrable-types": ["warn"],
"@typescript-eslint/no-this-alias": ["warn"],
"prefer-const": ["warn"],
"prefer-spread": ["warn"],
"no-var": ["warn"],
"no-unused-vars": "off",

"@typescript-eslint/no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
}],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],
},
},
}];
];
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
"scripts": {
"start": "run-p 'processCSS -- --watch' 'transpileES -- --watch' 'generateTypes -- --watch' serve-example",
"dev": "npm install && npm run build && npm run install-examples && npm run start",
"pack-dev": "npm run build && npm run copy-build && cd dev-build && npm pack",
"serve-example": "cd examples && npm run serve-example",
"install-examples": "npm install && cd examples && npm install",
"build": "npm-run-all generateTypes transpileES processCSS",
"generateTypes": "tsc -p tsconfig.base.json --emitDeclarationOnly",
"transpileES": "cross-env TS_NODE_PROJECT=tsconfig.es.json BABEL_ENV=es babel src --out-dir es --extensions .ts,.tsx,.js,.jsx --ignore 'src/test'",
"processCSS": "postcss src/viewport/index.css --output es/style/style.css",
"copy-build": "copyfiles 'es/**/*' style/* 'type-declarations/**/*' package.json README.md dev-build",
"processCSS": "postcss src/style/style.css --output es/style/style.css",
"copy-build": "copyfiles 'es/**/*' 'type-declarations/**/*' package.json README.md dev-build",
"gh-build": "npm run processCSS && cd examples && npm run build-example",
"lint": "eslint src/**",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"test": "vitest run",
"coverage": "vitest run --coverage",
"typeCheck": "tsc -p tsconfig.json --noEmit",
Expand All @@ -28,7 +29,6 @@
},
"files": [
"es",
"style",
"type-declarations",
"README.md",
"package.json"
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Viewport from "./viewport/index.js";
import "./style/style.css";

export type {
SelectionStateInfo,
Expand Down
File renamed without changes.
Loading