Skip to content

Commit

Permalink
lint typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
sluger committed May 22, 2022
1 parent 97a9274 commit 3e9a159
Show file tree
Hide file tree
Showing 7 changed files with 1,823 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
.husky
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-env node */

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
};
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ npm run build

Find the artifacts in the `/dist` folder.

# Examples

Open `/examples/index.html` in the browser.

# Development

The dev environment is configured with Prettier, Husky, lint-staged, eslint for TypeScript and Jest.

# Testing

```bash
npm test
```

Runs a jest test creating an AceEditor instance.

# Examples

Open `/examples/index.html` in the browser.
5 changes: 3 additions & 2 deletions examples/PrestoSqlMode.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ace.define('ace/mode/prestosql', [], function (require, exports, module) {
/* eslint-disable no-undef */
ace.define('ace/mode/prestosql', [], function (require, exports) {
var oop = require('ace/lib/oop');
var TextMode = require('ace/mode/text').Mode;
var PrestoSqlHighlightRules = require('ace/mode/prestosql_highlight_rules').PrestoSqlHighlightRules;
Expand All @@ -15,7 +16,7 @@ ace.define('ace/mode/prestosql', [], function (require, exports, module) {
exports.Mode = Mode;
});

ace.define('ace/mode/prestosql_highlight_rules', [], function (require, exports, module) {
ace.define('ace/mode/prestosql_highlight_rules', [], function (require, exports) {
var oop = require('ace/lib/oop');
var TextHighlightRules = require('ace/mode/text_highlight_rules').TextHighlightRules;

Expand Down
8 changes: 3 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-env node */

module.exports = {
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testEnvironment: 'jsdom',
preset: 'ts-jest',
};
Loading

0 comments on commit 3e9a159

Please sign in to comment.