-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10522 from archesproject/10516-cbyrd-adds-vue-typ…
…escript-support-and-linter Adds typescript support and vue/typescript linting #10516
- Loading branch information
Showing
36 changed files
with
1,085 additions
and
424 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
module.exports = { | ||
"extends": [ | ||
"eslint:recommended", | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:vue/vue3-recommended', | ||
], | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "vue-eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module", | ||
"requireConfigFile": false, | ||
"parser": { | ||
"ts": "@typescript-eslint/parser" | ||
} | ||
}, | ||
"globals": { | ||
"define": false, | ||
"require": false, | ||
"window": false, | ||
"console": false, | ||
"history": false, | ||
"location": false, | ||
"Promise": false, | ||
"setTimeout": false, | ||
"URL": false, | ||
"URLSearchParams": false, | ||
"fetch": false | ||
}, | ||
"ignorePatterns": [".eslintrc.js", "**/media/plugins/*"], | ||
"rules": { | ||
"semi": ["error", "always"], | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "*.vue" ], | ||
"rules": { | ||
"vue/html-indent": [2, 4], | ||
"vue/this-in-template": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ "*.js" ], | ||
"rules": { | ||
"indent": ["error", 4], | ||
"space-before-function-paren": ["error", "never"], | ||
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error | ||
// allow async-await | ||
'generator-star-spacing': 'off', | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
'no-unused-vars': [1, { | ||
argsIgnorePattern: '^_' | ||
}], | ||
"camelcase": [1, {"properties": "always"}], | ||
} | ||
} | ||
] | ||
}; | ||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// import declarations from other projects or Arches core | ||
|
||
// declare modules that have been added to your project (should mirror `package.json`) | ||
declare module 'arches'; | ||
declare module "@babel/runtime"; | ||
declare module "@mapbox/geojson-extent"; | ||
declare module "@mapbox/geojsonhint"; | ||
declare module "@mapbox/mapbox-gl-draw"; | ||
declare module "@mapbox/mapbox-gl-geocoder"; | ||
declare module "@tmcw/togeojson"; | ||
declare module "@turf/turf"; | ||
declare module "backbone"; | ||
declare module "bootstrap"; | ||
declare module "bootstrap-colorpicker"; | ||
declare module "chosen-js"; | ||
declare module "ckeditor4"; | ||
declare module "codemirror"; | ||
declare module "core-js"; | ||
declare module "cross-env"; | ||
declare module "cross-fetch"; | ||
declare module "cytoscape"; | ||
declare module "cytoscape-cola"; | ||
declare module "d3"; | ||
declare module "datatables.net"; | ||
declare module "datatables.net-bs"; | ||
declare module "datatables.net-buttons"; | ||
declare module "datatables.net-buttons-bs"; | ||
declare module "datatables.net-responsive"; | ||
declare module "datatables.net-responsive-bs"; | ||
declare module "dom4"; | ||
declare module "dropzone"; | ||
declare module "eonasdan-bootstrap-datetimepicker"; | ||
declare module "font-awesome"; | ||
declare module "ionicons"; | ||
declare module "jqtree"; | ||
declare module "jquery"; | ||
declare module "jquery-migrate"; | ||
declare module "jquery-validation"; | ||
declare module "jqueryui"; | ||
declare module "js-cookie"; | ||
declare module "knockout"; | ||
declare module "knockout-mapping"; | ||
declare module "knockstrap"; | ||
declare module "latlon-geohash"; | ||
declare module "leaflet"; | ||
declare module "leaflet-draw"; | ||
declare module "leaflet-iiif"; | ||
declare module "leaflet.fullscreen"; | ||
declare module "lt-themify-icons"; | ||
declare module "mapbox-gl"; | ||
declare module "metismenu"; | ||
declare module "moment"; | ||
declare module "moment-timezone"; | ||
declare module "nouislider"; | ||
declare module "numeral"; | ||
declare module "primevue"; | ||
declare module "proj4"; | ||
declare module "regenerator-runtime"; | ||
declare module "requirejs"; | ||
declare module "requirejs-plugins"; | ||
declare module "requirejs-text"; | ||
declare module "select-woo"; | ||
declare module "select2"; | ||
declare module "underscore"; | ||
declare module "uuidjs"; | ||
declare module "vue"; | ||
declare module "vue3-gettext"; | ||
declare module "webpack-bundle-tracker"; | ||
|
||
// declare filetypes used in `./src/` folder | ||
declare module '*.ts'; | ||
declare module '*.vue'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!.eslintrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
module.exports = { | ||
"extends": [ | ||
"eslint:recommended", | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:vue/vue3-recommended', | ||
], | ||
"root": true, | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "vue-eslint-parser", | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module", | ||
"requireConfigFile": false, | ||
"parser": { | ||
"ts": "@typescript-eslint/parser" | ||
} | ||
}, | ||
"globals": { | ||
"define": false, | ||
"require": false, | ||
"window": false, | ||
"console": false, | ||
"history": false, | ||
"location": false, | ||
"Promise": false, | ||
"setTimeout": false, | ||
"URL": false, | ||
"URLSearchParams": false, | ||
"fetch": false | ||
}, | ||
"ignorePatterns": [".eslintrc.js", "**/media/plugins/*"], | ||
"rules": { | ||
"semi": ["error", "always"], | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "*.vue" ], | ||
"rules": { | ||
"vue/html-indent": [2, 4], | ||
"vue/this-in-template": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ "*.js" ], | ||
"rules": { | ||
"indent": ["error", 4], | ||
"space-before-function-paren": ["error", "never"], | ||
"no-extra-boolean-cast": 0, // 0=silence, 1=warning, 2=error | ||
// allow async-await | ||
'generator-star-spacing': 'off', | ||
// allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | ||
'no-unused-vars': [1, { | ||
argsIgnorePattern: '^_' | ||
}], | ||
"camelcase": [1, {"properties": "always"}], | ||
} | ||
} | ||
] | ||
}; | ||
|
9 changes: 9 additions & 0 deletions
9
arches/install/arches-app-templates/app_name/src/declarations.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// import declarations from other projects or Arches core | ||
import('../media/node_modules/arches/declarations.d.ts'); | ||
|
||
// declare modules that have been added to your project (should mirror dependencies in `package.json`) | ||
declare module 'arches'; | ||
|
||
// declare filetypes used in `./src/` folder | ||
declare module '*.vue'; | ||
declare module '*.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"events": { | ||
"start": "clear" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
{ | ||
"name": "{{ app_name }}", | ||
"version": "0.0.1", | ||
"license": "AGPL-3.0-only", | ||
"scripts": { | ||
"eslint:check": "./{{ app_name }}/media/node_modules/.bin/eslint ./{{ app_name }}/src --resolve-plugins-relative-to ./{{ app_name }}/media --ext .vue,.ts --parser ./{{ app_name }}/media/node_modules/vue-eslint-parser/index.js", | ||
"eslint:watch": "./{{ app_name }}/media/node_modules/.bin/nodemon --watch ./{{ app_name }}/src --ext ts,vue --exec yarn --silent eslint:check", | ||
"gettext:extract": "./{{ app_name }}/media/node_modules/.bin/vue-gettext-extract", | ||
"gettext:compile": "./{{ app_name }}/media/node_modules/.bin/vue-gettext-compile" | ||
"gettext:compile": "./{{ app_name }}/media/node_modules/.bin/vue-gettext-compile", | ||
"ts:check": "./{{ app_name }}/media/node_modules/.bin/vue-tsc --noEmit", | ||
"ts:watch": "./{{ app_name }}/media/node_modules/.bin/vue-tsc --watch --noEmit" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.3.4", | ||
"vue3-gettext": "^3.0.0-beta.4" | ||
}, | ||
"devDependencies": { | ||
"arches-dev-dependencies": "archesproject/arches-dev-dependencies#{{ arches_version }}" | ||
}, | ||
"nodeModulesPaths": { | ||
}, | ||
"resolutions": { | ||
"node-gyp": "^10.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"resolveJsonModule": true, | ||
"jsx": "preserve", | ||
"jsxImportSource": "vue", | ||
"noImplicitThis": false, | ||
"strict": true, | ||
"verbatimModuleSyntax": true, | ||
"target": "ESNext", | ||
"useDefineForClassFields": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"skipLibCheck": true, | ||
"baseUrl": "./{{ app_name }}/src/", | ||
"paths": { | ||
"@/*": [ | ||
"*.ts", | ||
"*.vue", | ||
], | ||
}, | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
"**/*.vue", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.