...
 
Commits (14)
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yaml,json}]
indent_size = 2
indent_style = space
[*.md]
trim_trailing_whitespace = false
{
"env": {
"browser": true,
"es6": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"airbnb-base",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"ignorePatterns": ["**/*.js"],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"prettier/prettier": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": "off",
"indent": 0,
"no-tabs": 0,
"global-require": 0,
"import/prefer-default-export": 0,
"class-methods-use-this": 0,
"@typescript-eslint/no-use-before-define": 0
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}
## JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
*.iml
.idea/
.tmp/
jsconfig.json
## Sublime workspace files
*.sublime-workspace
## Visual Studio Code
.vscode/
# node/bower
node_modules/
npm-debug.log
bower_components/
*.log.*
# Mac system files
.DS_Store
# Blacklight files
blacklight_modules/
# sass
.sach-cache/
# Conflict resolution files
*.orig
{
"useTabs": true,
"trailingComma": "es5",
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"printWidth": 100
}
{
"extends": "stylelint-config-suitcss",
"rules": {
"indentation": "tab",
"declaration-colon-newline-after": null,
"function-comma-newline-after": null,
"function-parentheses-newline-inside": null,
"selector-no-vendor-prefix": null,
"string-quotes": "single",
"value-no-vendor-prefix": null,
"order/properties-alphabetical-order": null,
"rule-empty-line-before": null,
"at-rule-empty-line-before": [
"always",
{
"except": ["blockless-after-blockless", "first-nested"],
"ignore": ["after-comment"],
"ignoreAtRules": ["if", "else"]
}
],
"property-no-vendor-prefix": null,
"value-list-comma-newline-after": null,
"block-closing-brace-newline-after": [
"always",
{
"ignoreAtRules": ["if", "else"]
}
]
}
}
Some change
\ No newline at end of file
# TypeScript Blacklight Module Template
This is the initial setup for a new TypeScript Blacklight module.
## Getting Started
- Put all of your `.ts` files into directories inside the `src` directory.
- Do not put `.ts` files directly below the `src` directory.
- Transpiled code is outputted to root directory
## Directories
```
.
├── public # Assets to be served to the browser (JS, CSS, images)
├── src
│ ├── apps # Module specific routes and helper functions
│ └── components # Code to process data and the templates to render that data
└── ...
```
## Running Tests
Run test with `yarn test`.
Run tests with watcher by running `yarn test-watch`.
## Formatting / Linting
On `git commit`, the following formatters/linters will be run on your code:
- Prettier
- `src/**/*.{js,ts}`
- `**/*.json`
- ESLint
- `src/**/*.{js,ts}`
- StyleLint
- `public/**/*.css`
{
"name": "__NAME__",
"version": "0.0.1",
"description": "New BL module",
"scripts": {
"test": "jest --verbose",
"test-watch": "yarn test -- --watch",
"lint": "eslint 'src/**/*.{js,ts}'",
"lint:fix": "yarn lint --fix"
},
"dependencies": {},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.28.0",
"@typescript-eslint/parser": "^2.28.0",
"eslint": "^7.0.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"husky": "^4.2.5",
"jest": "^26.0.1",
"lint-staged": "^10.2.4",
"prettier": "^2.0.5",
"stylelint": "^13.4.1",
"typescript": "^3.8.3"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,ts}": [
"npx prettier --write",
"eslint --fix"
],
"**/*.json": [
"npx prettier --write"
],
"public/**/*.css": [
"stylelint --fix"
]
}
}
# Public
Hosts files which are served to web browser (css, js, etc.)
# Apps
Module specific routes and helper functions
# Components
Code to process data and the templates to render that data
{
"compilerOptions": {
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
"lib": [
"es2016",
"esnext.asynciterable"
] /* Specify library files to be included in the compilation. */,
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "" /* Redirect output structure to the directory. */,
"rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
"removeComments": true /* Do not emit comments to output. */,
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
"emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"exclude": ["node_modules"],
"include": ["src/**/*.ts"]
}