Commit graph

44 commits

Author SHA1 Message Date
syl20bnr
b97ad90c92 web-beautify: fix definition of web-beautify key bindings
Needs to use `pre-init` function in order to have the variable
spacemacs-web-beautify--modes to be populated before the init function of
web-beautify is actually called.
2018-05-19 01:53:33 -04:00
syl20bnr
30e366fd40 react: add spacemacs prefix to functions in funcs.el 2018-05-19 01:16:18 -04:00
syl20bnr
8fd934c209 react: set emmet-expand-jsx-className? to t 2018-05-19 01:15:04 -04:00
syl20bnr
542ada133d New layer web-beautify extracted from javascript layer
Make html, javascript, json and react layers depend on it
2018-05-18 01:25:29 -04:00
syl20bnr
c15b65435e react: make react layer depends on new tern layer 2018-05-18 01:25:29 -04:00
Ting Zhou
8616f07b86 Add: use rjsx-mode for react framework
Fix: add yas-activate-extra-mode
Add: add lsp support for react layer
Add: Add rjsx-mode key-bindings doc
Clean: rename spacemacs//set-lsp-key-bindings to spacemacs//setup-lsp-jump-handler
Fix: remove buggy hooks
Clean: move fix-lsp-company-prefix to lsp layer
Fix: rjsx-mode company
Fix: rjsx-mode lsp backend
2018-05-18 01:25:29 -04:00
syl20bnr
ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
syl20bnr
29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr
326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Jam Risser
bff4cf5857 Use JSX header without breaking React
Using the header below is now deprecated in React.
```js
/** @jsx React.DOM */
```

However, there are situations where I have to use the *.js extension, and need to tell my text editor that the file has JSX.

I suggest switching to JSX mode if it detects a header starting with `@jsx`. Then I'll be able to do the following without breaking react.

```js
/** @jsx */
2017-07-06 14:36:15 +02:00
jupl
09ce56df3d Use add-node-modules-path to automatically find local executables 2017-06-07 16:49:11 +02:00
panjan
12f823ba3c react: improved react file recognition 2017-05-30 10:27:07 +02:00
syl20bnr
f45ce1a88e syntax-checking: rename function add-flycheck-hook to enable-flycheck
spacemacs/add-flycheck-hook was not really hooking anything, change the name
to better reflect what it does.
Also changed the push for a add-to-list to avoid duplicates.
2017-03-19 12:40:36 -04:00
syl20bnr
fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00
syl20bnr
74fdbb6795 Refactor and simplify company backends declaration
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).

All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.

This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)

The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).

The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.

The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
2017-01-02 00:39:04 -05:00
syl20bnr
c725823e73 javascript and react: reformat code and move funcs to funcs.el
Some conventional cleanup.
Note that the function `spacemacs/js2-refactor-set-key-bindings` has been
removed since it is not used anywhere.
2017-01-01 22:45:23 -05:00
syl20bnr
7d8b6bd0f6 react: Fix emmet -> emmet-mode 2016-10-09 21:44:35 -04:00
Kai Pruess
0d70306b90 Add emmet-mode to react-mode
Closes syl20bnr/spacemacs#5130
2016-10-08 19:45:58 +02:00
syl20bnr
85ace24553 react: fix tern setup
The init function should be a post-init instead of an init function.
Also simplified the configuratin quite a bit.
2016-06-21 19:04:59 -04:00
Shahin
cc2a38fc76 Add javascript-standard as a flycheck checker to react-mode
By default the only available checker in `react-mode` is
javascript-eslint. `javascript-standard` is based on `javascript-eslint`
and has some modification on rules. Since it's not defined as a checker
for this mode, it's also impossible to select it in a buffer.
2016-06-05 21:24:42 -04:00
syl20bnr
a2de9a63af Use :toggle keyword instead of when forms 2016-05-29 22:39:21 -04:00
sooheon
15e6290151 Make check for company-mode explicit, not implicit
People may have company-mode installed without necessarily using the
auto-completion layer.
2016-05-27 00:32:05 -04:00
Andrea Moretti
b772734394 react: remove probably useless snippet 2016-04-29 23:30:44 -04:00
Andrea Moretti
cb55e3da3c react: fix tern and docs 2016-04-29 23:30:21 -04:00
Andrea Moretti
f88a7889a4 react: use node_modules version of eslint or global if not available 2016-04-29 23:30:05 -04:00
Andrea Moretti
c80c9583db add import React magic-mode-alist
as suggested by @tko on #4735
2016-04-21 21:07:38 -04:00
Andrea Moretti
5c07ce0118 enforce smartparens 2016-04-21 21:07:38 -04:00
Andrea Moretti
a3e802b2ff remove js2 and fix eslint loading 2016-04-21 21:07:38 -04:00
syl20bnr
b1a6d8977a react: prefer named function over lambda for hooks 2016-03-09 20:10:58 -05:00
huaoguo
70d4c2c784 Fix bug: helm-imenu doesn't work in react-mode
In react-mode, when invoke helm-imenu, the list is empty. Because this
feature is only enabled in js2-mode, not js2-minor-mode.

So we should enable it by ourself.

link: https://github.com/mooz/js2-mode/blob/master/js2-mode.el#L11557
2016-03-09 20:09:07 -05:00
Tommi Komulainen
faed1b7dc0 react: make evil-matchit jump between html/jsx tags as well
Fixes: #5265
2016-03-01 18:59:18 +01:00
EMayej Bee
de7eb40337 Fix react magic mode 2016-02-09 21:37:22 +01:00
Eivind Fonn
e9f8377b92 Tweak flycheck loading process 2016-01-31 23:04:48 -05:00
Eivind Fonn
248abe254f Don't auto-quote attributes in react 2016-01-22 15:47:21 +01:00
syl20bnr
046d86800c Clean copyrights and update for year 2016 2016-01-11 21:42:17 -05:00
Erwan Loisant
5361447599 Auto-activate for react native index files 2016-01-04 00:23:56 -05:00
Eivind Fonn
ac0ba50154 Make flycheck/flyspell hooks more explicit 2015-12-11 02:08:55 -05:00
R. Haluk Öngör
d498c091bf Enable js-mode snippets in react mode 2015-12-04 00:08:26 -05:00
justbur
9befd20a1a layers: Transition to new key bindings functions
Removes dependence on evil-leader centralizing control over the method
of key binding in core-keybindings.el
2015-11-21 18:22:51 +01:00
Sebastian Wiesner
954ed2d3de react: Fix Flycheck setup
Do not disable jshint globally, but only for React Mode.  It’s perfectly
fine to use jshint for a Javascript project and eslint for a React
project.  A layer should not enforce its language specific preferences
upon everything else, and above all, you should NEVER disable syntax
globally without a very good reason.

Also remove the redundant expression disabling json-jsonlist, which
simply does not exist.
2015-11-13 13:52:20 +01:00
Eivind Fonn
56ecd43753 Add variables to opt-in to flycheck/flyspell 2015-10-10 23:18:46 -04:00
Diego Berrocal
c9612ffef0 Expand to className when using emmet
div.react-class >>> <div className="react-class"></div>
2015-10-09 12:06:40 +02:00
David Mohl
15de481a80 forcing jsx content type, fixes #3163 2015-09-28 23:21:03 -04:00
justbur
6eab954afe Use + instead of ! for layer categories
Helm seems to treat "!" specially in pattern matching, so having a ! in
the pattern string when traversing directories is problematic. This
change fixes #2737, because as far as I can tell "+" has no special
meaning in a helm pattern.

Of course, we can choose a different character, but I'm fond of "+" as
representing "more layers here".
2015-09-11 00:13:51 -04:00
Renamed from layers/!frameworks/react/packages.el (Browse further)