Skip to content

Commit

Permalink
Further removing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Sep 12, 2024
1 parent 3cb95ce commit 5602fc8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 143 deletions.
8 changes: 2 additions & 6 deletions ui/packages/consul-ui/app/components/code-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ const DEFAULTS = {
lineNumbers: true,
theme: 'hashi',
showCursorWhenSelecting: true,
gutters: ['CodeMirror-lint-markers'],
lint: true,
};
export default Component.extend({
settings: service('settings'),
dom: service('dom'),
helper: service('code-mirror/linter'),
classNames: ['code-editor'],
readonly: false,
syntax: '',
Expand All @@ -26,7 +23,6 @@ export default Component.extend({
oninput: function () {},
init: function () {
this._super(...arguments);
set(this, 'modes', this.helper.modes());
},
didReceiveAttrs: function () {
this._super(...arguments);
Expand All @@ -51,7 +47,6 @@ export default Component.extend({

const editor = this.editor;
editor.setOption('mode', mode.mime);
this.helper.lint(editor, mode.mode);
set(this, 'mode', mode);
}
},
Expand All @@ -76,7 +71,8 @@ export default Component.extend({
});
set(this, 'value', $code.firstChild.wholeText);
}
set(this, 'editor', this.helper.getEditor(this.element));
// set(this, 'editor', this.helper.getEditor(this.element));
set(this, 'editor', this.dom.element('textarea + div', this.element).CodeMirror);
this.settings.findBySlug('code-editor').then((mode) => {
const modes = this.modes;
const syntax = this.syntax;
Expand Down
51 changes: 0 additions & 51 deletions ui/packages/consul-ui/app/services/code-mirror/linter.js

This file was deleted.

43 changes: 0 additions & 43 deletions ui/packages/consul-ui/app/utils/editor/lint.js

This file was deleted.

27 changes: 1 addition & 26 deletions ui/packages/consul-ui/ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,7 @@ module.exports = function (defaults, $ = process.env) {
},
codemirror: {
keyMaps: ['sublime'],
addonFiles: [
'lint/lint.css',
'lint/yaml-lint.js',
'mode/loadmode.js',
],
addonFiles: ['mode/loadmode.js'],
},
sassOptions: {
implementation: require('sass'),
Expand Down Expand Up @@ -268,27 +264,6 @@ module.exports = function (defaults, $ = process.env) {
// CSS.escape polyfill
app.import('node_modules/css.escape/css.escape.js', { outputFile: 'assets/css.escape.js' });

// Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/codemirror/mode/javascript/javascript.js', {
outputFile: 'assets/codemirror/mode/javascript/javascript.js',
});

// HCL/Ruby linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/codemirror/mode/ruby/ruby.js', {
outputFile: 'assets/codemirror/mode/ruby/ruby.js',
});

// YAML linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/js-yaml/dist/js-yaml.js', {
outputFile: 'assets/codemirror/mode/yaml/yaml.js',
});
app.import('node_modules/codemirror/mode/yaml/yaml.js', {
outputFile: 'assets/codemirror/mode/yaml/yaml.js',
});
// XML linting support. Possibly dynamically loaded via CodeMirror linting. See services/code-mirror/linter.js
app.import('node_modules/codemirror/mode/xml/xml.js', {
outputFile: 'assets/codemirror/mode/xml/xml.js',
});
// metrics-providers
app.import('vendor/metrics-providers/consul.js', {
outputFile: 'assets/metrics-providers/consul.js',
Expand Down

This file was deleted.

0 comments on commit 5602fc8

Please sign in to comment.